Removing CLOSE button "on the fly"

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

3 posts / 0 new
Last post
Removing CLOSE button "on the fly"

Submitted by Anonymous (not verified) on Fri, 06/15/2012 - 12:07

I am fairly new with Motif. I am trying to figure out how to remove and restore the "close" button the root window after initializing the window.
I figured out how to use the XmNmwmFunctions to remove the close button INSIDE the call to XtVaAppInitialize. What my program should be able to do is change the menu back and forth from having a close button, to not having a close button without reinitializing everything.
Simply, I want to be able to toggle this option throughout my code...if possible.
Any ideas?
Thanks for your help
‹ How to change another app/widget background? Motif 1.2 source code available ›

guiqueen

Fri, 07/15/2005 - 23:42#1

Removing CLOSE button "on the fly"

Instead of reinitializing the interface each time, try enabling and
disabling the settings for your XmNmwmFunctions on your topLevel
shell in an XtVaSetValues call. For example,

XtVaSetValues(applicationShell1,
XmNmwmFunctions, "MWM_FUNC_CLOSE", NULL);

XtVaSetValues(applicationShell1,
XmNmwmFunctions, "MWM_FUNC_ALL", NULL);

The available settings are:

XmNmwmFunctions
MWM_FUNC_ALL - All functions are set
MWM_FUNC_RESIZE - Resize
MWM_FUNC_MOVE - Move
MWM_FUNC_MINIMIZE - Minimize
MWM_FUNC_MAXIMIZE - Maximize
MWM_FUNC_CLOSE - kill

thand

Mon, 07/18/2005 - 13:59#2

Tried That

Good answer, but I already tried messing with the XmNmwmFunctions. The problem is that we have two modes for this particular window: Control and Monitor. We would like to be able to close through the root window in monitor mode but NOT close in control mode. The XmNmwmFunctions does not take away the close button when we perform this switch.

I think my solution will be to change the function of the close button. I found a way to disable the button after a mode switch so that it pops up an error message instead of closing the window.

Thanks for the help!