tkinter resize question

Terry Reedy tjreedy at udel.edu
Sat Jul 18 01:49:22 EDT 2015


On 7/17/2015 9:31 PM, nickgeovanis at gmail.com wrote:
> On Friday, July 17, 2015 at 5:55:19 PM UTC-5, Terry Reedy wrote:
>> On 7/17/2015 2:53 PM, nickgeovanis at gmail.com wrote:
>>> Resizing a tkinter window which contains a frame which contains a
>>> button widget, will not change the current size of the window, frame
>>> or button as recorded in their height and width attributes (at least
>>> not if they are resizable).
>>
>> Post the code and experiments performed that leads you to believe the above.
>
> It's really boring but here you are:
>
> [ngeo at localhost src]$ python3
> Python 3.4.2 (default, Dec 20 2014, 13:53:33)
> [GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import tkinter
>>>> win=tkinter.Tk()
>>>> frame=tkinter.Frame(win, bg="blue", width=200, height=200)
>>>> butt1=tkinter.Button(fg="green", bg="black")
>>>> frame.grid()
>>>> butt1.grid()
>>>> butt1["width"]
> 0
>>>> butt1["height"]
> 0
>>>> win["width"]
> 0
>>>> win["height"]
> 0

I believe these configuration settings should be interpreted a 'initial 
size' (if not default) or 'desired size' or possibly min or max size, 
depending on the grid or pack settings.

-- 
Terry Jan Reedy




More information about the Python-list mailing list