Solved

XWindows Titlebar close button help

Posted on 1998-08-06
8
207 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
 
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now