diff options
author | Pixel <pixel@nobis-crew.org> | 2010-06-15 00:59:57 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2010-06-15 00:59:57 -0700 |
commit | eed0eb6a476d54ce19aeff137984aa981d9e3976 (patch) | |
tree | 807891636efd2f87dcbd261e971216269973ae07 /iup/src/gtk/iupgtk_menu.c | |
parent | ccc8261e4d48de89da4ddfe7b55e378ae0cd6f47 (diff) |
Upgrading to iup 3.1
Diffstat (limited to 'iup/src/gtk/iupgtk_menu.c')
-rwxr-xr-x | iup/src/gtk/iupgtk_menu.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/iup/src/gtk/iupgtk_menu.c b/iup/src/gtk/iupgtk_menu.c index c12fbea..772f4cf 100755 --- a/iup/src/gtk/iupgtk_menu.c +++ b/iup/src/gtk/iupgtk_menu.c @@ -245,11 +245,19 @@ static int gtkMenuMapMethod(Ihandle* ih) return IUP_NOERROR; } +static void gtkMenuUnMapMethod(Ihandle* ih) +{ + if (iupMenuIsMenuBar(ih)) + ih->parent = NULL; + + iupdrvBaseUnMapMethod(ih); +} + void iupdrvMenuInitClass(Iclass* ic) { /* Driver Dependent Class functions */ ic->Map = gtkMenuMapMethod; - ic->UnMap = iupdrvBaseUnMapMethod; + ic->UnMap = gtkMenuUnMapMethod; /* Used by iupdrvMenuGetMenuBarSize */ iupClassRegisterAttribute(ic, "STANDARDFONT", NULL, NULL, IUPAF_SAMEASSYSTEM, "DEFAULTFONT", IUPAF_DEFAULT); /* use inheritance to retrieve standard fonts */ @@ -337,15 +345,10 @@ static int gtkItemSetValueAttrib(Ihandle* ih, const char* value) static char* gtkItemGetValueAttrib(Ihandle* ih) { - if (GTK_IS_CHECK_MENU_ITEM(ih->handle)) - { - if (gtk_check_menu_item_get_active((GtkCheckMenuItem*)ih->handle)) - return "ON"; - else - return "OFF"; - } + if (GTK_IS_CHECK_MENU_ITEM(ih->handle) && gtk_check_menu_item_get_active((GtkCheckMenuItem*)ih->handle)) + return "ON"; else - return NULL; + return "OFF"; } static int gtkItemMapMethod(Ihandle* ih) |