I have a window I made with Tkinter, I'd like to be able to minimize it. This is in Windows 7 FYI.
In Tkinter, minsize() method is used to set the minimum size of the Tkinter window. Using this method user can set window's initialized size to its minimum size, and still be able to maximize and scale the window larger. Here, height and width are in pixels.
Locking window size simply means the user won't be able to change the window size. To do so, we will pass (0,0) in the resizable method. Here 0,0 refers to False for width & Height. resizable method instructs window manager if this window can be resized or not.
We can customize the geometry of the window using the geometry method. However, in order to maximize the window, we can use the state() method which can be used for scaling the tkinter window. It maximizes the window after passing the “zoomed” state value to it.
>>> import Tkinter
>>> w = Tkinter.Tk()
>>> w.wm_state('iconic')
Should work and minimize the window to the taskbar.
To minimize it to the taskbar as a button:
w.iconify()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With