Re: How to grey out menu items

On Sun, Sep 20, 2015 at 9:30 AM, richard boaz <ivor boaz gmail com> wrote:
Hi Stefan,

this question also came up a few years ago, where i detailed the solution i
have employed for this problem here:

i subsequently formalized this into a self-contained library, with a
complete description of it here:

and, feel free to find the complete source code for free download here:

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).

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]