[pygtk] PyGTK Button Size Question
enginespot at gmail.com
Thu Dec 10 00:15:13 WST 2009
I will go on learning pygtk development and also I will study glade-3
2009/12/10 John Stowers <john.stowers.lists at gmail.com>
> On Thu, 2009-12-10 at 00:02 +0800, engine spot wrote:
> > Hi John
> > when I test your code ,I find that the button's height is
> > ok,400px,but the width is fill
> > when I change vb = gtk.VBox() to vb = gtk.HBox()
> > run your code ,then the width is 100px, ok,but the height is fill
> > is it true I need to use gtk's another object but not HBox and
> > VBox?
> > which object is ok?
> import gtk
> Window = gtk.Window(gtk.WINDOW_TOPLEVEL)
> hb = gtk.HBox()
> vb = gtk.VBox()
> hb.pack_start(vb, False, False)
> vb.pack_start(Button, False, False)
> HBox considers expand and fill pack parameters horizontally, and VBox
> considers them vertically. So depending on your GUI you sometimes need
> But a simple button in a window is not the best way to learn how Gtk+
> GUI packing works, it is not a real world case and will just continue to
> confuse you.
> I suggest using glade-3 to design some different GUIs, and experimenting
> with the effect of expand and fill when packing widgets.
> In general you should not set minimum/default size (this is not windows
> forms). It is best to accomplish the GUI layout you want using the
> correct application of packing rules, and correct uses of alignments and
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pygtk