Drew
Drew

Reputation: 2663

PyGTK Update Sibling Widget Label

Just getting started with PyGTK and Glade3 and would love some help.

Container Hierarchy: window -> vbox1 -> {button1 , label1}

button1 calls back to

on_button1_clicked(self, widget):

                          print "Hello World!" #This sends the output to the console
                          widget.set_label("Hello World!") #This updates button1's label

                          #I'd like to update label1's label as well in the same callback

I know this can be done using label1.set_text(string), but I don't know how to retrieve that object any ideas?

Thanks from KY.

Upvotes: 0

Views: 118

Answers (1)

killown
killown

Reputation: 4917

label = builder.get_object('label1')
label.set_text('foobar')

Upvotes: 1

Related Questions