Solved

XWindows Titlebar close button help

Posted on 1998-08-06
8
216 Views
Last Modified: 2013-12-26
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
Comment
Question by:gunn
8 Comments
 
LVL 2

Expert Comment

by:JYoungman
ID: 1295487
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
 

Author Comment

by:gunn
ID: 1295488
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
 

Author Comment

by:gunn
ID: 1295489
Adjusted points to 150
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 3

Expert Comment

by:braveheart
ID: 1295490
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
 

Expert Comment

by:sparlin
ID: 1295491
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
 

Author Comment

by:gunn
ID: 1295492
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
 

Author Comment

by:gunn
ID: 1295493
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
 
LVL 3

Accepted Solution

by:
braveheart earned 150 total points
ID: 1295494
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question