[pygtk] PyGTK Button Size Question

engine spot enginespot at gmail.com
Wed Dec 9 23:43:12 WST 2009


do you means this:


# Create a new window
        self.Window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.Button=gtk.Button("Hello")
        self.Window.add(self.Button)
        self.Button.set_border_width(0)
        #self.Button.set_size_request(100,400)
        self.Window.set_default_size(200,600)
        self.Expander=gtk.Expander()
        self.Expander.set_size_request(100,400)
        self.Expander.add(self.Button)
        self.Expander.set_expanded(False)
        self.Button.show()
        self.Expander.show()
        self.Window.show()
or
# Create a new window
        self.Window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.Button=gtk.Button("Hello")
        self.Window.add(self.Button)
        self.Button.set_border_width(0)
        self.Button.set_size_request(100,400)
        self.Window.set_default_size(200,600)
        self.Expander=gtk.Expander()
        #self.Expander.set_size_request(100,400)
        self.Expander.add(self.Button)
        self.Expander.set_expanded(False)
        self.Button.show()
        self.Expander.show()
        self.Window.show()

when I test all of these,the button always fill the window



2009/12/9 John Stowers <john.stowers.lists at gmail.com>

> >
> >
> >     the default window's width is 200,and height is 600,but the button
> > fill the window,do I make something wrong?
>
> You said it yourself, it sets the minimum size. The widget can grow, and
> it does when it is packed into the window.
>
> If you do not want the widget to expand into all available space, then
> pack it into a container with the appropriate values for fill and expand
> set (False)
>
> John
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20091209/cf7a3984/attachment-0001.htm 


More information about the pygtk mailing list