Shading and Deactivating a Sub-Menu



I've searched through the archives, but the last time someone asked a similar
question they were told to go and look at the gimp sourcecode, which I thought
was a rather unhelpful response... ;-)

I have a menu created with the Item Factory, and I would like to deactivate
parts of it programmatically and have the deactivated bits shaded out.

Consider the following menu item with a sub-menu containing two items.

static GtkItemFactoryEntry menu_items[] = {
{  "Menu",                   ................. },
{  "Menu/Sub1",           ..................},
{  "Menu/Sub1/Item1",   ..................},
{  "Menu/Sub1/Item2",   ..................}
};

Now, if I use gtk_item_factory_get_widget() to get a pointer to (for example) 
"Menu/Sub1/Item1" and then use gtk_widget_set_sensitive() to deactivate it, 
all is well.  The item shades out and is no longer accessable.

However, I *cannot* seem to do the same thing on the complete submenu.  
If I try to change the sensitivity of  "Menu/Sub1"  I would expect the submenu
item to grey out.  It *does* deactivate, but it doesn't shade out...  Why? 
And how do I do this?   I really would like the submenu to shade out, 
otherwise I feel the behaviour is inconsistent with the way individual items 
in the menu deactivate....


-- 
David J. Singer
doc deadvirgins org uk
"Time flies like an arrow, fruit flies like a banana"



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