これはうまくいきません:
image_log = gtk.Image()
image_log.set_from_file("test.png")
self.out_button = gtk.Button()
self.out_button.add(image_log)
self.err_button = gtk.Button()
self.err_button.add(image_log)
another_box.pack_start(self.out_button, False)
another_box.pack_start(self.err_button, False)
問題は、image_log が 2 回使用され、GTK が気に入らないことです。.copy() メソッドはありますか? または、プレーンなバニラのディープコピーを使用する必要がありますか?
編集: GTK でオブジェクトを複製するデフォルトの方法はないようです。この場合、Factory がそのトリックを行います。
GTK 警告:
app/gui.py:248: GtkWarning: gtk_box_pack: assertion `child->parent == NULL' failed
hbox_errlog.pack_start(image_log)