LaurelLynn
April 26th, 2007, 10:43 PM
Hi Boys,
I'm old to programming but new to Python. Since there are no fixed types or recasting, I can't figure out how my program can change widget properties in callbacks. For example, this is some of my basic Hello World Code:
class HellowWorldGTK:
def __init__(self):
#Set the Glade file
self.gladefile = "TopMa/topma.glade"
self.wTree = gtk.glade.XML(self.gladefile)
#Create our dictionay and connect it
dic = { "on_hiButton_clicked" : self.hi_clicked,
"on_MainWin_destroy" : gtk.main_quit }
self.wTree.signal_autoconnect(dic)
#callback for hi button
def hi_clicked(self, widget):
print "Top of the World Ma!!!"
The callback "hi_clicked" just prints the text to the command line, but what I want, is to change the button's label in the callback.
A GUI isn't very useful if I can't pass settings back and forth.
Can someone help a damsel in distress?
I'm old to programming but new to Python. Since there are no fixed types or recasting, I can't figure out how my program can change widget properties in callbacks. For example, this is some of my basic Hello World Code:
class HellowWorldGTK:
def __init__(self):
#Set the Glade file
self.gladefile = "TopMa/topma.glade"
self.wTree = gtk.glade.XML(self.gladefile)
#Create our dictionay and connect it
dic = { "on_hiButton_clicked" : self.hi_clicked,
"on_MainWin_destroy" : gtk.main_quit }
self.wTree.signal_autoconnect(dic)
#callback for hi button
def hi_clicked(self, widget):
print "Top of the World Ma!!!"
The callback "hi_clicked" just prints the text to the command line, but what I want, is to change the button's label in the callback.
A GUI isn't very useful if I can't pass settings back and forth.
Can someone help a damsel in distress?