[Glade-users] how to click "close window" don't close GTK window?



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



any help will be appreciate. 



--

?????????????????????? 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20090914/3e6611a2/attachment.html 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]