0

PyGTKとGlade3を使い始めたばかりで、助けが必要です。

コンテナ階層:window-> vbox1-> {button1、label1}

button1はにコールバックします

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

label1.set_text(string)を使用してこれを実行できることは知っていますが、そのオブジェクトを取得する方法がわかりません。

KYからありがとう。

4

1 に答える 1

1
label = builder.get_object('label1')
label.set_text('foobar')
于 2010-08-18T01:56:27.683 に答える