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?

Recommended Answers

All 2 Replies

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

kath.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.