hi,everyone
I have a GTK window,when click "close window" ,I want to show a verify dialog that whether verify really quit or not.so I used a MesssageDialog for verify quit.But when I clicked the "NO" button on the verify dialog,the GTK window also closed.
The GTK window I make for glade,and I set the signal are "delete_event","close" and "response" all don't doing it.
any help will be appreciate.
2 8143
Well, I guess you're attaching a callback function to the 'delete-event' singal, correct? Well, depending on the response from the dialog window, your callback should return either TRUE (continue with delete event), or FALSE (cancel delete event). This is what I remember from my brief work with it using PHP-Gtk.
@Markus
thanks Markus,my code is as following: -
def show_verify_dialog(self,str):
-
verdialog = gtk.MessageDialog(type=gtk.MESSAGE_QUESTION,buttons=gtk.BUTTONS_YES_NO,message_format=str)
-
verd = verdialog.run()
-
verdialog.destroy()
-
if verd == gtk.RESPONSE_YES:
-
return True
-
else:
-
return False
-
-
def gtk_widget_destroy(self,window,event=None):
-
mesg = 'Would you like to quit TLait?'
-
if show_verify_dialog(self,mesg):
-
gtk.main_quit()
-
else:
-
return
-
Meanwhile,I set the signal is "delete_event",but the problem is as same
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Bruce A. Julseth |
last post by:
How do I emulate the web page "Close" Button, i. e. the "X" in the upper
right hand corner of each web page?
Thank you....
Bruce
|
by: Franklin P Patchey |
last post by:
<P><A style="COLOR: rgb(0,0,0); FONT-SIZE: 80%; FONT-FAMILY: 'Comic Sans
MS', cursive; TEXT-
ALIGN: left"
href="javascript:self.close();"><FONT size=4><STRONG>Close this...
|
by: Rob Evans |
last post by:
Please excuse my ignorance on this matter.. but....
What exactly is the definition of a "pop-up window" - by that I mean one
which will be blocked by software such as the Google Toolbar and...
|
by: Willem van Rumpt |
last post by:
Hi all,
coming from an unmanaged programming background, I took my time to
sort out the IDisposable and finalizer patterns. Just when I thought
I had it all conceptually neatly arranged, the...
|
by: Martijn Coppoolse |
last post by:
Hello everyone,
I've got two little apps which are able to create a window that displays
something on the desktop, but are not clickable. Instead, when you
click on the window, the item...
|
by: studen771 |
last post by:
Thanks in advance to anyone who can help :):
I have an .aspx page that creates javascript on the fly within a button
click event handler. The script creates a function AND CALLS THAT SAME...
|
by: gg9h0st |
last post by:
i saw a code refactorying onload event listener
window.onloadListeners=new Array();
window.addOnLoadListener=function(listener) {
window.onloadListeners=listener;
}
why declare the...
|
by: anEchteTrilingue |
last post by:
Hi everybody. Thank you for reading my post.
I am having trouble getting "this" to work in all versions of IE (it's fine in Firefox, opera, konqueror, etc). What I would like to do is add an...
|
by: Jeremy J Starcher |
last post by:
While reading c.l.j, I've noticed that some people prefer and indeed even
recommend the use of "window.alert()" over "alert()".
I can't find any technical reason to make this distinction, and...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |