Re: gtkitemfactory radio menu items

On Monday 15 Apr 2002 10:57 pm, Owen Taylor wrote:
Ian Thompson-Bell <ian ruffrecords uklinux net> writes:
On Friday 12 Apr 2002 11:14 pm, Ian Thompson-Bell wrote:
How to I associate radio menu items, in a gtkitemfactory created
submenu, with a group?



I finaly managed to answer my own question.  It turns out GtkItemFactory
assigns eaxh radiomenubutton its own seaprate group so you have to change
this so the ones you want grouping are in the same group.  the way this
is done is similar to grouping radiobuttons but you have separate
functions to get and set the group.  So I wrote a function that appends a
radiomenu button to a group:

From gtk+/demos/gtk-demo/itemfactory.c:

  { "/_Preferences/Color/_Red",               NULL, gtk_ifactory_cb, 0, "<RadioItem>" },
  { "/_Preferences/Color/_Green",     NULL, gtk_ifactory_cb, 0,
"/Preferences/Color/Red" }, { "/_Preferences/Color/_Blue",    NULL,
gtk_ifactory_cb, 0, "/Preferences/Color/Red" },


Damn, it's always there so long as you know where to look.  It's not in 
gtkref, not in the headers, not in Eric Harlows book of Havoc's, it's in the 
one place I didn't look.


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