[pygtk] ... and nothing appears

Adam Tauno Williams awilliam at whitemice.org
Thu Feb 3 05:29:14 WST 2011


I'm happily using PyGtk / Glade-3 and have pretty much recreated an app
I've previously made in C# / Gtk#.  But I have one frustrating bit.  I
need to fill a scrolled area with sections of text - but *nothing*
appears.  Just an empty ScrolledWindow.

#  task_notation_area is a Viewport in the ScrolledWindo
child = self.task_notation_area.get_child()
if (child is not None):
  self.task_notation_area.remove(child)
vbox = gtk.VBox()
for annotation in self.task['_NOTES']:
  print 'rendering notation {0}'.format(annotation['objectId'])
  print annotation['comment']
  label = gtk.Label()
  label.set_text(annotation['comment'])
  vbox.pack_end(label, expand=True, fill=True, padding=2)
self.task_notation_area.add(vbox)
self.task_notation_area.resize_children()

What is the trick for stacking widgets in a scrolled area?



More information about the pygtk mailing list