[pygtk] [Fwd: Gtk.Box, homogeneous and expand]

craf pyclutter at gmail.com
Wed Jan 4 01:15:19 WST 2012


>And I don't see how to use that if I have two pack_start() and one pack_end()
>and want all my objects to be of the same size, like this :

>[|abc|| a |          | . |]

Hi.

test if it helps

import gtk


class App:
    
    def __init__(self):
        
        self.window = gtk.Window()
        self.window.set_default_size(100, 100)
        self.window.set_position(gtk.WIN_POS_CENTER)
        
        self.hbox = gtk.HBox()
        
        self.button1 = gtk.Button("1234")
        self.button1.set_size_request(50, -1)
        
        self.button2 = gtk.Button("123")
        self.button2.set_size_request(50, -1)
        
        self.button3 = gtk.Button("12")
        self.button3.set_size_request(50, -1)
        
        self.hbox.pack_start(self.button1, False)
        self.hbox.pack_start(self.button2, False)
        self.hbox.pack_end(self.button3, False)
        

        
        self.window.add(self.hbox)
        self.window.show_all()
        
        self.window.connect("destroy", lambda e:gtk.main_quit())

App()
gtk.main()

Best Regards

Cris
_______________________________________________
pygtk mailing list   pygtk at daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/





More information about the pygtk mailing list