[pygtk] member variable default value

Imre Horvath blemidon at gmail.com
Fri Aug 7 14:09:57 WST 2009


Hi!

I want to create a dict like this:

class MainWindow:

	signals = {
		'on_action1_activate': self.on_action1,
	}

	def __init__(self):
		...

	def on_action1(self):
		...

It results:
NameError: name 'self' is not defined.

I've tried it without the self, MainWindow.on_action1, etc. but no
luck...

Thanks in advance:
Imre Horvath



More information about the pygtk mailing list