Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

XWindows Titlebar close button help

I have a application where when the user picks Quit, it asks them if they really want to with the option of saying yes or cancelling and continuing working in the program (which works fine).

However, when you pick the top-right Titlebar close button, the callback where the question dialog is located will be called, the message will pop up, but no matter what I choose, the application closes! The pop-up dialog is returning the right value, but its like the program has no where to 'return' to from the function and quits instead of returning to running the program.

Anyway to make the program continue ok if the user selects 'Cancel' the quit.?

Thanks,

Tom
0
gunn
Asked:
gunn
1 Solution
 
JYoungmanCommented:
If I recall correctly, there is a mechanism for your application to tell the window manager that the request to close the window is to be delayed or even cancelled.  Take a look at the ICCCM manual, it'll be in there.


0
 
gunnAuthor Commented:
Hmmm, I don't know what manual that is, but I'll try to see if others do. As it stands, this hasn't given me the solution to the problem at hand...

0
 
gunnAuthor Commented:
Adjusted points to 150
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
braveheartCommented:
Which window manager are you using?  I don't know of one where there is a close button at the top right of the title bar.
0
 
sparlinCommented:
Motif applications half functions called "call back" functions. WHen you click on a button or type something on the keyboard, the XtMainLoop will catch it and execute the appropriate callback. Example, there might be a button that says "quit", once you click on that button a "call back" function is executed with code that will exit the application. It's possible that this application has an incorrectly configured "call back" function, and if that's the case it is a bug with the application, at which point you have two choices, call the vender or edit the source code and look for the error...

My 2 cents
0
 
gunnAuthor Commented:
Well, the vendor is us ;)

Anyway, I know the whole philosophy behind Xwindows...I code in it(!) but with the close button on the title bar, it will jump to the "close" callback function which in that asks if you *really* want to quit. Upon saying NO, it will quit anyway.

This ONLY happens with that titlebar quit/close button. With our normal "Quit" button, the callback function is called, and if the user chooses NO, it will return to the loop.
 
0
 
gunnAuthor Commented:
In response to braveheart, i'm sorry, I was using another windows manager which puts the close butotn on the other side.

In the Motif windows manager, I'm talking about the close button on the top-left of the window...the one that you double-click to quit the application. At this point, our CloseCB is called, which asks if you "really want to quit?". No matter what you select though, it quits when double-clicking on this button.  This CB works fine in any other area.

Hope that helps...

0
 
braveheartCommented:
Is the passButtons resource on the window manager set to True? I don't know if this will help because normally the WM acts on button clicks before the client.

Is showFeedback set to "kill", which should cause the "really want to quit" dialog to be displayed.

You could set wMenuButtonClick2 to False which would disable a double-click quit.

You could also set the client resource "clientFunctions" to "-close" which would disable the quit feature.

Note that the precise names of these resources may vary between window managers but there ought to be something similar.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now