[pygtk] Multi-paned window
Luigi Paioro
luigi at lambrate.inaf.it
Wed Jan 25 16:33:59 WST 2006
Thanks Tony, but I need resizing! This is the trouble. I can do the same
thing you exampled me with a gtk.Table()...
What can be another solution?
Thanks.
Luigi
Tony Nelson wrote:
> Well, if you don't need to let your users resize the panes individually,
> then a normal HBox or VBox should do the trick. If you need
resizing, then
> it will be more involved, but I think it can be done by adding more
widgets
> in between.
>
> #! /usr/bin/env python2.3
> # -*- coding: utf-8 -*-
> '''multiple "panes"
> '''
>
> import gtk
>
> class TestWind(gtk.Window):
> def __init__(self):
> gtk.Window.__init__(self)
> self.connect('destroy', self.on_destroy)
> self.set_default_size(400, 400)
>
> vbox = gtk.VBox(True, 4)
> self.add(vbox)
> vbox.show()
> for i in range(3):
> hbox = gtk.HBox(True, 4)
> vbox.add(hbox)
> hbox.show()
> for j in range(3):
> tv = gtk.TextView()
> hbox.add(tv)
> tv.show()
>
> self.show()
>
> def on_destroy(self, wid):
> gtk.main_quit()
>
> TestWind()
> gtk.main()
More information about the pygtk
mailing list