Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

XWindows Titlebar close button help

Posted on 1998-08-06
8
219 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Question regarding Copy/Paste 16 96
Creating Labels and Frequency list style reports in SAS code 9 105
bigDiff challenge 17 123
Sed question 2 100
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: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

840 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