0

I am working with Glade to make a simple GUI application using PyGTK. I have two windows, one only showing up when a button is pressed.

    def on_preview_clicked(self, widget):
           print "You clicked the Preview button"
           prev = self.builder.get_object("previewWindow")
           prev.show()

The window is working fine, but if I close it, and try to open it again, it becomes empty. I found on google that it may be because the window I am referring to was "destroyed", so I made the window hide instead.

    def hide_preview(self, widget):
            print "Hide it!"
            prev = self.builder.get_object("previewWindow")
            prev.hide()
            return True

This did nothing, the window still comes up empty the second time around. What am I missing?

CodeMouse92
  • 6,840
  • 14
  • 73
  • 130
  • 2
    Can you create a minimal testcase that exhibits this problem? Maybe you're running into [this problem](http://faq.pygtk.org/index.py?req=show&file=faq10.013.htp) or something, but it's hard to say without more info. In general, doing hide() and show() should allow the widgets to remain in your window. – dumbmatter Aug 14 '11 at 16:34

1 Answers1

0

Without a working testcase of this, it's difficult to be sure, but try changing it from show() to show_all(), to be sure that all the child widgets of the window are shown as well.