Re: How to grey out menu items



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

do with it what you will,

richard

On Sat, Sep 19, 2015 at 11:07 PM, Tristan van Berkom <tristan upstairslabs com> wrote:


> On Sep 20, 2015, at 8:05 AM, Stefan Salewski <mail ssalewski de> wrote:
>
> OK, gtk_widget_set_sensitive () will do it.
>
> But I wonder how to do it for menu items that change sensitively often,
> for example COPY menu item. I can set it sensitive whenever something
> is selected in my application, for example a word in a text editor, and
> make it insensitive if nothing is selected. Of course this generates
> much noise. May it be better, and is it possible to do that on the fly,
> when the pulldown menu pops on? Maybe a signal which is emitted before
> the item becomes visible? Can not find something like that
> unfortunately.
>

This really shouldn't be a concern at the application level, as setting the sensitivity of a widget that is not currently visible should do no more than updating some internal state, the appearance of the given widget should then be computed at display time.

Best,
    -Tristan


> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> https://mail.gnome.org/mailman/listinfo/gtk-list
_______________________________________________
gtk-list mailing list
gtk-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-list



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