I have a class derived from a gtk.Window that I want to hide whenever
the 'x' button on the window is clicked.  

I am doing this (I also connect Cancel to hide)

class MyWindow(gtk.Window):

    def __init__(self):
        gtk.Window.__init__(self)

        def hide(*args):
            self.hide()

        self.connect('delete_event', hide)
        self.connect('destroy', hide)

        ...snip..
        button = gtk.Button(stock=gtk.STOCK_CANCEL)
        button.show()
        button.connect('clicked', hide)
        hbox.pack_start(button, gtk.TRUE, gtk.TRUE)        

        
I have a button that when clicked it shows the window. 

If I click cancel and then reshow, all is well.

Yet after I close the window by clicking the x button, when I reshow
it it has lost all it's widgets.

Am I missing something?

pygtk-2.2.0

JDH
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to