[pygtk] ... and nothing appears

Tim Evans t.evans at aranz.com
Thu Feb 3 05:32:53 WST 2011


On 2011-02-03 10:29, Adam Tauno Williams wrote:
> 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?

Looks like you're just missing a "label.show()" call in there.

-- 
Tim Evans
Senior Software Engineer
ARANZ Geo Limited
p: +64 3 374 6120  |  e: t.evans at aranz.com
Level 6, 227 Cambridge Terrace, PO Box 3894, Christchurch, New Zealand
www.aranzgeo.com


More information about the pygtk mailing list