Hi, Craf,

sorry to late reply, i have solved my problem.

here is my codes:

        #create num and op buttons
        for i in xrange(16):
            button = gtk.Button(self.num_tmp[i])
            button.set_size_request(-1, 25)
            num_buttons.append(button)

            button = gtk.Button(self.op_tmp[i])
            button.set_size_request(-1, 25)
            op_buttons[self.op_tmp[i]] = button

       #some codes here....

        #set fixed size for the right side buttons, because too many
buttons there
        for i in xrange(10):
            num_buttons[i].set_size_request(45,25) #first use
set_size_request set the size i want
            button_box = gtk.HBox() # then, create a box for each button,
one box for one button
            button_box.pack_start(num_buttons[i], False, False, 0) # set
expand and fill are False!
            fixed_size_numbox.append(button_box)

        #some codes here

        button_box = gtk.HBox() #create a big box for the above small boxes
:)
        button_box.pack_start(fixed_size_numbox[7], False, False, 7) # set
expand and fill are False! now it is ok, the size is just i want.
        button_box.pack_start(fixed_size_numbox[8], False, False, 7)
        button_box.pack_start(fixed_size_numbox[9], False, False, 7)
        button_box.pack_start(fixed_size_opbox["*"], False, False, 7)
        button_box.pack_start(fixed_size_opbox["/"], False, False, 7)
        vbox.pack_start(button_box, False, False, 0)

2012/4/21 craf <abarz...@gmail.com>

>
> >Hi All,
> >       when i put some buttons in a hbutton box, the hbutton box
> >becomes very long....
> >       i don't know how to set a button size, set_size_request has no
> >effect....
> >
> >       could anybody help me how to set the size for widgets?
> >       thanks
> >
> >      Lion
>
> Hi Lion
>
> Have your code to see you're doing?
>
> Regards
>
> Craf
>
>
>
> _______________________________________________
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to