On Fri, 20 Oct 2006 11:55:10 +0100
"Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote:

> Folks,
> 
> Sorry for asking you such a trivial question.!!! But i want to size up all
> the buttons with the same size as the largest one in the interface.. And
> thats why I am asking this question..
> 

Hi Asrarahmed,

in case you use Tkinter, something like this should do the trick (untested):

b1 = Button(master, text='Hi')
b1.grid(row=0, column=0, sticky='ew')
b2 = Button(master, text='Good-bye')
b2.grid(row=0, column=1, sticky='ew')

maxwidth = 0
for button in (b1, b2):
    w = button.winfo_reqwidth()
    if w > maxwidth:
        maxwidth = w

master.grid_columnconfigure(0, minsize=maxwidth)
master.grid_columnconfigure(1, minsize=maxwidth)

or, if this is an option for you, use a Pmw.ButtonBox and call its 
alignbuttons() method.

I hope this helps

Michael
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to