No, the items within the factory are just normal menu items (or
checkitems). What I mean is a gtk_option_menu_new() type of menu - i.e.
a button that pops up a menu.
I have stuff like this in old code:
mw->optionmenu_status = gtk_option_menu_new();
gtk_widget_show(mw->optionmenu_status);
...appending a bunch of stuff to menu_status
gtk_option_menu_set_menu(GTK_OPTION_MENU(mw->optionmenu_status),
mw->menu_status);
gtk_toolbar_append_widget(GTK_TOOLBAR(mw->toolbar),
mw->optionmenu_status, "Change Status", NULL);
I tried something like this with ItemFactory:
get_status_menu(mw->window, &mw->optionmenu_status);
gtk_widget_show(mw->optionmenu_status);
gtk_toolbar_append_widget(GTK_TOOLBAR(mw->toolbar),
mw->optionmenu_status, "Change Status", NULL);
get_status_menu is similar to the stuff in the tutorial except it sets
the type to GTK_TYPE_OPTION_MENU instead of GTK_TYPE_MENU_BAR.
For the items structure I have this:
static GtkItemFactoryEntry status_items[] =
{
{"/_Status", NULL, 0, 0, "<Title>" },
{"/Status/Available", NULL, handle_menu_status,
YAHOO_STATUS_AVAILABLE, "<Item>"},
{"/Status/sep1", NULL, 0,
YAHOO_STATUS_AVAILABLE, "<Separator>"},
{"/Status/1", NULL, handle_menu_status,
YAHOO_STATUS_AVAILABLE, "<Item>"},
{"/Status/2", NULL, handle_menu_status,
YAHOO_STATUS_AVAILABLE, "<Item>"},
{"/Status/3", NULL, handle_menu_status,
YAHOO_STATUS_AVAILABLE, "<Item>"}
};
This doesn't work.
I get a bunch of errors about bin->child being null.
-- Nathan
Craig Emery wrote:
>
> Nathan,
>
> You can look at Tony Gale's & Ian Main's gtk tutorial
>
> http://www.gtk.org/tutorial/gtk_tut-13.html#ss13.3
>
> for an example of using the gtk_item_factory
> functions.
>
> I've looked at the source code to Gtk+ and the only
> currently valid values for the "type" string are:
>
> "<Item>",
> "<Title>",
> "<RadioItem>",
> "<CheckItem>",
> "<ToggleItem>",
> "<Tearoff>",
> "<Separator>",
> "<Branch>",
> "<LastBranch>"
>
> I've not looked at the details of the RadioItem
> widget, but this seems to be one you could use for
> options.
>
> Yours,
>
> Craig.
>
> --- "Neulinger, Nathan R." <[EMAIL PROTECTED]> wrote: >
> I've got itemfactory working great with regular
> > menus, but I am having
> > difficulty getting it to work with option menus. The
> > option menu comes up
> > blank and cores with a null widget when I click on
> > it.
> >
> > When should one use the "<Title>" type instead of
> > "<Branch>"?
> >
> > Does anyone have a sample snippet of code that does
> > option menus with i/f?
> >
> > -- Nathan
>
> =====
> "Windows 95: 32 bit extensions and a graphical shell for a 16 bit
> patch to an 8 bit operating system originally coded for a 4 bit
> microprocessor, written by a 2 bit company that can't stand 1 bit of
> competition." -- Unknown
>
> __________________________________________________
> Do You Yahoo!?
> Send instant messages & get email alerts with Yahoo! Messenger.
> http://im.yahoo.com/
--
------------------------------------------------------------
Nathan Neulinger EMail: [EMAIL PROTECTED]
University of Missouri - Rolla Phone: (573) 341-4841
CIS - Systems Programming Fax: (573) 341-4216
--
To unsubscribe: mail -s unsubscribe [EMAIL PROTECTED] < /dev/null