Web lists-archives.com

Re: How to grey out menu items




On Sun, Sep 20, 2015 at 9:30 AM, richard boaz <ivor.boaz@xxxxxxxxx> wrote:
> Hi Stefan,
>
> this question also came up a few years ago, where i detailed the solution i
> have employed for this problem here:
> https://mail.gnome.org/archives/gtk-list/2010-September/msg00047.html
>
> i subsequently formalized this into a self-contained library, with a
> complete description of it here:
> http://www.binpress.com/app/gtk-widget-state-manager/1008
>
> and, feel free to find the complete source code for free download here:
> https://gitlab.com/ivor/GTK-WSM


just a note: doing this "properly" should involve Actions, not widgets.

it is unfortunate that neither GTK's own documentation, along with
most stuff I've read on GUI programming, doesn't emphasize the concept
of Actions as a more basic element of GUI programs.

why is this important? Because in any good GUI program, many of the
possible things a user can do should be drivable by both mouse/touch
based interaction with a widget, but also by other mechanism (such as
the keyboard, or external network control). By coding around widgets
as the basic concept, the design misses out on this basic truth.

if you use Actions, then you can make actions insensitive. This will
propagate to their on-screen proxies (widgets) but also to the
action's activability via other mechanisms (i.e. Action::activate()
will not do anything no matter who or what invokes it).
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list