In my __init__
function I'm trying to do:
builder = gtk.Builder()
builder.add_from_file('main.glade')
builder.connect_signals(Handle())
self.list = builder.get_objects()
Now I want to add attributes to my class for all the widgets in my gui
for i in self.list:
name = i.get_name()
print name
setattr(self, name, i)
I get:
<gtk.VBox object at 0x2fd5558 (GtkVBox at 0x2499000)>
<gtk.Button object at 0x2fd5580 (GtkButton at 0x240a1a8)>
<gtk.Button object at 0x2fd55a8 (GtkButton at 0x240a130)>
<gtk.Button object at 0x2fd55d0 (GtkButton at 0x240a0b8)>
<gtk.Window object at 0x2fd55f8 (GtkWindow at 0x2495010)>
<gtk.HBox object at 0x2fd5620 (GtkHBox at 0x2499058)>
<gtk.Button object at 0x2fd5648 (GtkButton at 0x240a220)>
<gtk.TextView object at 0x2fd5670 (GtkTextView at 0x249d060)>
And not the specific names I gave those widgets
Do you have ideas on how to initialize all the widgets at one?