[Glade-users] Glade questions.

Damon Chaplin damon@ximian.com
Fri, 16 Feb 2001 15:59:22 +0000


Matthew Tuck wrote:
> 
> Damon Chaplin wrote:
> 
> >> 2.  Is there some way I can declare a "disable condition", and disable
> >> lots of things at once in code?  One way might be if GLADE
> >> automatically generated a function that I can call into.
> > I don't understand this. What gets disabled?
> 
> Any widgets, usually menu items and toolbuttons.

Oh, I see. Yes, getting menu & toolbar button sensitivity working well is a
pain. Though I think allowing groups of widgets to be made insensitive only
helps a little. You often still have to write a function like
set_interface_state() in glade_menu_editor.c to work out which widgets should
be sensitive.

 
> >> 3.  Is there any way to insert columns into a CList widget once created?
> > You do that in your own code somewhere. Maybe after the call to create the
> > window (create_window1() etc.)
> 
> No I meant within Glade, before your program runs.

Oops. I thought you meant inserting rows. GtkCList doesn't support adding &
removing columns dynamically, unfortunately. So you have to remove it and
add a new GtkCList.

(Actually it is easier to change the <columns> setting in the XML file directly.)

 
> >> 5.  What's the best way to handle dynamic menus, both in the situation
> >> where the whole menu is dynamic, and only part of the menu is dynamic?
> >> In particular I can't find any way to create an empty submenu.
> > Create the stable part in Glade, then manipulate the widgets in your
> > code to add/remove menus. I don't think that would be too difficult.
> 
> Except, as I said, I can't figure out how to create an empty menu where
> nothing is stable.

You'll have to create the submenus yourself, and call gtk_menu_item_set_submenu()
to add them to the parent menu items. (Make sure you don't show the menus though.)

Damon