summaryrefslogtreecommitdiff
path: root/iup/src/gtk/iupgtk_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'iup/src/gtk/iupgtk_menu.c')
-rwxr-xr-xiup/src/gtk/iupgtk_menu.c21
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)