ToggleItem in item_factory
- From: Andreas Tille <tille physik uni-halle de>
- To: GTK User-List <gtk-list redhat com>
- Subject: ToggleItem in item_factory
- Date: Wed, 9 Dec 1998 21:10:42 +0100 (MET)
Hello,
I use a ToggleItem in an item_factory-entry this way:
/* ... */
GtkAccelGroup *accel_group;
GtkItemFactoryEntry
menu_items[] = {
/* ... */
{"/_Options", NULL, NULL, 0, "<Branch>" },
{"/Options/Show _advanced options", "a", AdvancedToggle, 0, "<ToggleItem>" },
/* ... */
};
/* create the dialog box */
shell = gtk_dialog_new ();
gtk_signal_connect (GTK_OBJECT (shell), "delete_event", GTK_SIGNAL_FUNC (win_delete), NULL);
/* create the main vbox */
vbox = GTK_DIALOG (shell)->vbox;
/* create the menubar */
accel_group = gtk_accel_group_new();
item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", accel_group);
gtk_item_factory_create_items(item_factory, sizeof(menu_items)/sizeof(menu_items[0]), menu_items,
NULL);
gtk_accel_group_attach (accel_group, GTK_OBJECT(vbox));
/* ..... */
What do I have to do, that the item is set to OFF when the program starts
instead of the default ON state?
Second question:
How can I disable menu items when the program starts and how can
I enable them under certain circumstance when the program is running?
Kind regards
Andreas.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]