forked from AuroraMiddleware/gtk
Added warning about callback on <Branch> items
This commit is contained in:
parent
b0f8915fe7
commit
75fff482b9
@ -1087,6 +1087,10 @@ gtk_item_factory_create_item (GtkItemFactory *ifactory,
|
||||
{
|
||||
GtkAccelGroup *menu_group;
|
||||
|
||||
if (entry->callback)
|
||||
g_warning ("gtk_item_factory_create_item(): Can't specify a callback on a branch: \"%s\"",
|
||||
entry->path);
|
||||
|
||||
menu_group = gtk_accel_group_new ();
|
||||
|
||||
if (type_id == quark_type_last_branch)
|
||||
@ -1103,7 +1107,9 @@ gtk_item_factory_create_item (GtkItemFactory *ifactory,
|
||||
|
||||
gtk_item_factory_add_item (ifactory,
|
||||
path, entry->accelerator,
|
||||
entry->callback, entry->callback_action, callback_data,
|
||||
(type_id == quark_type_branch ||
|
||||
type_id == quark_type_last_branch) ? NULL : entry->callback,
|
||||
entry->callback_action, callback_data,
|
||||
callback_type,
|
||||
item_type_path,
|
||||
widget);
|
||||
|
@ -2245,7 +2245,7 @@ gtk_ifactory_cb (gpointer callback_data,
|
||||
|
||||
static GtkItemFactoryEntry menu_items[] =
|
||||
{
|
||||
{ "/_File", NULL, gtk_ifactory_cb, 0, "<Branch>" },
|
||||
{ "/_File", NULL, 0, 0, "<Branch>" },
|
||||
{ "/File/tearoff1", NULL, gtk_ifactory_cb, 0, "<Tearoff>" },
|
||||
{ "/File/_New", "<control>N", gtk_ifactory_cb, 0 },
|
||||
{ "/File/_Open", "<control>O", gtk_ifactory_cb, 0 },
|
||||
@ -2254,17 +2254,17 @@ static GtkItemFactoryEntry menu_items[] =
|
||||
{ "/File/sep1", NULL, gtk_ifactory_cb, 0, "<Separator>" },
|
||||
{ "/File/_Quit", "<control>Q", gtk_ifactory_cb, 0 },
|
||||
|
||||
{ "/_Preferences", NULL, gtk_ifactory_cb, 0, "<Branch>" },
|
||||
{ "/_Preferences/_Color", NULL, gtk_ifactory_cb, 0, "<Branch>" },
|
||||
{ "/_Preferences", NULL, 0, 0, "<Branch>" },
|
||||
{ "/_Preferences/_Color", NULL, 0, 0, "<Branch>" },
|
||||
{ "/_Preferences/Color/_Red", NULL, gtk_ifactory_cb, 0, "<RadioItem>" },
|
||||
{ "/_Preferences/Color/_Green", NULL, gtk_ifactory_cb, 0, "<RadioItem>" },
|
||||
{ "/_Preferences/Color/_Blue", NULL, gtk_ifactory_cb, 0, "<RadioItem>" },
|
||||
{ "/_Preferences/_Shape", NULL, gtk_ifactory_cb, 0, "<Branch>" },
|
||||
{ "/_Preferences/_Shape", NULL, 0, 0, "<Branch>" },
|
||||
{ "/_Preferences/Shape/_Square", NULL, gtk_ifactory_cb, 0, "<RadioItem>" },
|
||||
{ "/_Preferences/Shape/_Rectangle", NULL, gtk_ifactory_cb, 0, "<RadioItem>" },
|
||||
{ "/_Preferences/Shape/_Oval", NULL, gtk_ifactory_cb, 0, "<RadioItem>" },
|
||||
|
||||
{ "/_Help", NULL, gtk_ifactory_cb, 0, "<LastBranch>" },
|
||||
{ "/_Help", NULL, 0, 0, "<LastBranch>" },
|
||||
{ "/Help/_About", NULL, gtk_ifactory_cb, 0 },
|
||||
};
|
||||
|
||||
|
@ -2245,7 +2245,7 @@ gtk_ifactory_cb (gpointer callback_data,
|
||||
|
||||
static GtkItemFactoryEntry menu_items[] =
|
||||
{
|
||||
{ "/_File", NULL, gtk_ifactory_cb, 0, "<Branch>" },
|
||||
{ "/_File", NULL, 0, 0, "<Branch>" },
|
||||
{ "/File/tearoff1", NULL, gtk_ifactory_cb, 0, "<Tearoff>" },
|
||||
{ "/File/_New", "<control>N", gtk_ifactory_cb, 0 },
|
||||
{ "/File/_Open", "<control>O", gtk_ifactory_cb, 0 },
|
||||
@ -2254,17 +2254,17 @@ static GtkItemFactoryEntry menu_items[] =
|
||||
{ "/File/sep1", NULL, gtk_ifactory_cb, 0, "<Separator>" },
|
||||
{ "/File/_Quit", "<control>Q", gtk_ifactory_cb, 0 },
|
||||
|
||||
{ "/_Preferences", NULL, gtk_ifactory_cb, 0, "<Branch>" },
|
||||
{ "/_Preferences/_Color", NULL, gtk_ifactory_cb, 0, "<Branch>" },
|
||||
{ "/_Preferences", NULL, 0, 0, "<Branch>" },
|
||||
{ "/_Preferences/_Color", NULL, 0, 0, "<Branch>" },
|
||||
{ "/_Preferences/Color/_Red", NULL, gtk_ifactory_cb, 0, "<RadioItem>" },
|
||||
{ "/_Preferences/Color/_Green", NULL, gtk_ifactory_cb, 0, "<RadioItem>" },
|
||||
{ "/_Preferences/Color/_Blue", NULL, gtk_ifactory_cb, 0, "<RadioItem>" },
|
||||
{ "/_Preferences/_Shape", NULL, gtk_ifactory_cb, 0, "<Branch>" },
|
||||
{ "/_Preferences/_Shape", NULL, 0, 0, "<Branch>" },
|
||||
{ "/_Preferences/Shape/_Square", NULL, gtk_ifactory_cb, 0, "<RadioItem>" },
|
||||
{ "/_Preferences/Shape/_Rectangle", NULL, gtk_ifactory_cb, 0, "<RadioItem>" },
|
||||
{ "/_Preferences/Shape/_Oval", NULL, gtk_ifactory_cb, 0, "<RadioItem>" },
|
||||
|
||||
{ "/_Help", NULL, gtk_ifactory_cb, 0, "<LastBranch>" },
|
||||
{ "/_Help", NULL, 0, 0, "<LastBranch>" },
|
||||
{ "/Help/_About", NULL, gtk_ifactory_cb, 0 },
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user