0

I am trying to activate the Help > About button with no succes.
I made a GUI with Glade3 with only a menu item in the main window.
Here's my code:

#!/usr/bin/env python
import sys
try:
import pygtk
pygtk.require("2.0")
except:
pass
try:
import gtk
import gtk.glade
except:
sys.exit(1)

class Test:
def __init__(self):
self.gladefile = "123.glade"
self.widgetTree = gtk.glade.XML(self.gladefile)
d = {"on_window1_destroy" : gtk.main_quit}
self.widgetTree.signal_autoconnect(d)

def on_menu(self,widget):
self.show.gtk.AboutDialog()


if __name__ == "__main__":

g = Test()
gtk.main()

Can you help me out, please?

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by johnnybgoode
0

It is difficult to follow your code unless it is properly indented. Post your code within code tags.

kath.

Edited by pritaeas: Fixed formatting

0

Here follows my code

#!/usr/bin/env python
import sys
try:
	import pygtk
	pygtk.require("2.0")
except:
	pass
try:
	import gtk
	import gtk.glade
except:
	sys.exit(1)

class Test:
	def __init__(self):
		self.gladefile = "123.glade"
		self.widgetTree = gtk.glade.XML(self.gladefile)
		d = {"on_window1_destroy" : gtk.main_quit}
		self.widgetTree.signal_autoconnect(d)
		self.ab=self.widgetTree.get_widget("aboutdialog1")
		
	def on_menu(self,widget):     # orig.  "on_imagemenuitem10_activate"
		self.show.gtk.AboutDialog()
		

if __name__ == "__main__":
	
	g = Test()
	gtk.main()

Already thanks for your reply.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.