Re: How to remove MenuItem from Menu?




On Wed, 21 Oct 2009, Peter Daum wrote:

There are several functions to dynamically change/reorder menus,
but I couldn't find or figure out a way how to remove a certain
item from a Menu. Is this possible? How?

(I tried some strange things like calling item->destroy
and was not surprised that it didn't work ...)

You might want to consider making an item inactive rather than
removing it -- depending on the context, of course.

I think it's typically more user-friendly, or user-informative, to
make an inapplicable menu item inactive.  If the item is not
there, the user may wonder, "Huh, can't this program do X?", but
if it's there and inactive the user may realize, "Yes, it can do
X, but there's something about the current state that makes X
unavailable."

Anyway, if a menu item represents a GtkAction, it can be made
inactive via gtk_action_set_sensitive().

Allin Cottrell



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