开发者

PyGTK Update Sibling Widget Label

开发者 https://www.devze.com 2023-01-12 12:30 出处:网络
Just getting started with PyGTK and Glade3 and would love some help. 开发者_高级运维 Container Hierarchy:

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.


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

精彩评论

暂无评论...
验证码 换一张
取 消