diff options
Diffstat (limited to 'iup/src/mot/iupmot_menu.c')
-rwxr-xr-x | iup/src/mot/iupmot_menu.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/iup/src/mot/iupmot_menu.c b/iup/src/mot/iupmot_menu.c index be9b953..8f51334 100755 --- a/iup/src/mot/iupmot_menu.c +++ b/iup/src/mot/iupmot_menu.c @@ -125,7 +125,10 @@ static void motPopupMenuUnmapCallback(Widget w, Ihandle* ih, XtPointer call_data static void motMenuUnMapMethod(Ihandle* ih) { if (iupMenuIsMenuBar(ih)) + { XtDestroyWidget(ih->handle); + ih->parent = NULL; + } else XtDestroyWidget(XtParent(ih->handle)); /* in this case the RowColumn widget is a child of a MenuShell. */ } @@ -146,7 +149,6 @@ static int motMenuMapMethod(Ihandle* ih) XmNrowColumnType, XmMENU_BAR, XmNmarginHeight, 0, XmNmarginWidth, 0, - XmNresizeWidth, False, NULL); if (!ih->handle) return IUP_ERROR; @@ -161,8 +163,8 @@ static int motMenuMapMethod(Ihandle* ih) if (iupAttribGetBoolean(ih, "RADIO")) { - iupmotSetArg(args, num_args, XmNpacking, XmPACK_COLUMN); - iupmotSetArg(args, num_args, XmNradioBehavior, TRUE); + iupMOT_SETARG(args, num_args, XmNpacking, XmPACK_COLUMN); + iupMOT_SETARG(args, num_args, XmNradioBehavior, TRUE); } ih->handle = XmCreatePulldownMenu( @@ -183,7 +185,7 @@ static int motMenuMapMethod(Ihandle* ih) { /* top level menu used for IupPopup */ - iupmotSetArg(args, num_args, XmNpopupEnabled, XmPOPUP_AUTOMATIC); + iupMOT_SETARG(args, num_args, XmNpopupEnabled, XmPOPUP_AUTOMATIC); ih->handle = XmCreatePopupMenu( iupmot_appshell, @@ -307,19 +309,19 @@ static int motItemMapMethod(Ihandle* ih) if (iupAttribGetBoolean(ih->parent, "RADIO")) { - iupmotSetArg(args, num_args, XmNtoggleMode, XmTOGGLE_BOOLEAN); - iupmotSetArg(args, num_args, XmNindicatorType, XmONE_OF_MANY_ROUND); - iupmotSetArg(args, num_args, XmNindicatorOn, XmINDICATOR_CHECK_BOX); - iupmotSetArg(args, num_args, XmNindicatorSize, 13); - iupmotSetArg(args, num_args, XmNselectColor, iupmotColorGetPixel(0, 0, 0)); + iupMOT_SETARG(args, num_args, XmNtoggleMode, XmTOGGLE_BOOLEAN); + iupMOT_SETARG(args, num_args, XmNindicatorType, XmONE_OF_MANY_ROUND); + iupMOT_SETARG(args, num_args, XmNindicatorOn, XmINDICATOR_CHECK_BOX); + iupMOT_SETARG(args, num_args, XmNindicatorSize, 13); + iupMOT_SETARG(args, num_args, XmNselectColor, iupmotColorGetPixel(0, 0, 0)); } else { if (iupAttribGetBoolean(ih, "HIDEMARK")) - iupmotSetArg(args, num_args, XmNindicatorOn, XmINDICATOR_NONE); + iupMOT_SETARG(args, num_args, XmNindicatorOn, XmINDICATOR_NONE); else - iupmotSetArg(args, num_args, XmNindicatorOn, XmINDICATOR_CHECK); - iupmotSetArg(args, num_args, XmNlabelType, iupAttribGet(ih, "TITLEIMAGE")? XmPIXMAP: XmSTRING); + iupMOT_SETARG(args, num_args, XmNindicatorOn, XmINDICATOR_CHECK); + iupMOT_SETARG(args, num_args, XmNlabelType, iupAttribGet(ih, "TITLEIMAGE")? XmPIXMAP: XmSTRING); } ih->handle = XtCreateManagedWidget( |