On Sun, Sep 03, 2000 at 05:58:11PM +0200, Alexandre Fayolle wrote:
> Hi, I have a problem with the pack_start and pack_end methods of
> GtkH/VBox: it seems to me that both of them they are always packing the
> widget at the 'end' of my box. Is it a known problem of pygtk or gtk ?
>
> I'm using pygtk-0.6.6 with gtk+-1.2.6 on a redhat 6.2 machine.
>
>
> Here is a demo session :
>
> >>> from gtk import *
> >>> import GTK
> >>> w=GtkWindow(GTK.WINDOW_DIALOG,'test')
> >>> box=GtkVBox()
> >>> w.add(box)
> >>> box.pack_start(GtkLabel('label 1'))
> >>> box.pack_start(GtkLabel('label 2'))
> >>> box.pack_end(GtkLabel('label 3'))
> >>> w.show_all()
> >>> while events_pending():mainiteration()
> ...
> >>> w.show_all()
> >>> while events_pending():mainiteration()
> ...
>
> And I get 3 labels, 'label 1', 'label 2' and 'label 3' in that order
> (instead of the expected 'label 2', 'label 1', 'label 3')
You get the labels in the correct order. pack_start and pack_end
are filling the box from the beginning and from the end:
START END
pack_start(label1):
START label1 END
pack_end(label2):
START label1 label2 END
pack_start(label3):
START label1 label3 label2 END
pack_end(label4):
START label1 label3 label4 label2 END
You should read the chapter about boxes in the gtk tutorial.
>
> Any help appreciated (as you might have guessed, I'm trying to pack a
> widget at the beginning of my VBox...)
>
> --
> Alexandre Fayolle
> Logilab
>
>
> _______________________________________________
> pygtk mailing list [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
>
--
Tom Cato Amundsen <[EMAIL PROTECTED]>
GNU Solfege - free eartraining, http://www.gnu.org/software/solfege/
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk