3

I'm drawing an interface for a pygtk application using glade, and I've made an about dialog. I'm having trouble with the close button in the about dialog. The close button in the credits operates as expected, but in the about dialog the button does nothing, so it has to be closed with the windows manager. I went to select the button by clicking on it and by expanding the items contained in the GtkHButtonBox, but I can't expand it in the top right section, and if I click on it it just selects the GtkHButtonBox. I've looked it up and found GtkAboutDialog Close Button Bug and About Dialog I tried following those instructions, but thought they seemed a bit funny since it puts destroy immediately after show, and that's exactly what it's doing, it just destroys it straight away after showing it. I also looked in the pygtk tutorial but that hasn't been updated since 2005, so doesn't have anything about the about dialog.

filename = "sudoku_gui.glade"
builder = gtk.Builder()
builder.add_from_file(filename)
builder.connect_signals(self)
aboutWindow = builder.get_object('about_Sudoku')
aboutWindow.show()

Please help me with it, I'll be much appreciated.

Solution: Because the solution doesn't directly provide the detail needed, I'll put it in here for reference. The last line should be changed to

aboutWindow.run()

not show(), then add

aboutWindow.destroy()

which will close the dialog when the close button is clicked.

Community
  • 1
  • 1
Bianca
  • 283
  • 1
  • 4
  • 15
  • Posting the code that's not working would help. – Tom Zych Sep 12 '11 at 09:33
  • 1
    `aboutWindow.destroy()` will unpack the window too, so it's undesirable if you are expecting the dialog to be opened again. I used `aboutWindow.hide()` which work in this case – Avinash R Jul 16 '13 at 14:03

1 Answers1

-2

Try this page : http://zetcode.com/tutorials/pygtktutorial/dialogs/

Hope this helps.

Louis
  • 2,854
  • 2
  • 19
  • 24