Environment:
- Built interface using Glade3.
- Backend is written in Python using the GTK+ Builder library.
-
Although I know the method I need to use to update a label's text (label.set_text("string")), I'm having trouble obtaining the label object in the python code.
Here's what my code looks like:
#!/usr/bin/python
# Filename: HelloPython.py
# Author: Andrew Hefley Carpenter
# Date: 18 August 2010
import sys
import gtk
class HelloPython:
def on_window_destroy(self, widget, data=None):
gtk.main_quit()
def __init__(self):
builder = gtk.Builder()
builder.add_from_file("HelloPython.xml")
self.window = builder.get_object("window")
builder.connect_signals(self)
def on_button1_clicked(self, widget):
print "Hello World!"
widget.set_label("Hello World!")
#I'd like to update
if __name__ == "__main__":
editor = HelloPython()
editor.window.show()
gtk.main()
End goal: I want to update "Object X" using it's set_text method after the callback to "Object Y" (in this case button1) as handled by "on_button1_clicked"