[pygtk] Toolbar layout button to right

Edward Stow ed.stow at gmail.com
Thu Feb 21 03:16:14 WST 2008


On Wed, Feb 20, 2008 at 10:36 AM, Gian Mario Tagliaretti
<gianmt at gnome.org> wrote:
> On Feb 20, 2008 12:21 AM, Edward Stow <ed.stow at gmail.com> wrote:
>
>  Hi Edward,
>
>
>  > I'm having trouble packing a toolbar.
>  >
>  > I require a toolbar with 3 buttons packed to the left and one that is
>  > always on the right. As illustrated below.
>  >
>  > [Button1__Button2__Button3__________________________________Button4]
>
>  You can use a gtk.SeparatorToolItem setting its expand property to True.
>  http://www.pygtk.org/docs/pygtk/class-gtkseparatortoolitem.html

This almost works except when you set_visible_horizontal(False) - to
hide the vertical bar  naturally voids the expand property.

But using  a ToolItem does work:

       toolbar = gtk.Toolbar()

       sep = gtk.ToolItem()
       sep.set_expand(True)

       toolbar.insert(gtk.ToolButton(None, 'Button 1'), 0)
       toolbar.insert(sep, 1)
       toolbar.insert(gtk.ToolButton(None, 'Button 2'), 2)

-- 

Edward Stow


More information about the pygtk mailing list