Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

XWindows Titlebar close button help

Posted on 1998-08-06
8
Medium Priority
?
235 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
[X]
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
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 300 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

688 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