Python tkinter minimize or maximize the windows

Example of minimize or maximize the TK window in Python

Following code show the example of minimize or open the tk window as below:

tkWindow.state(newstate=’iconic’) is used for the minimize the window.

tkWindow.state(newstate=’normal’) is used for the maximize the window.

from tkinter import *
import time

#tkwindow in the 
tkWindow = Tk()  
tkWindow.title('Test the utility')

#set window background color

#Set the state newstate
def minimize1(): 
    #make the window minimize 
    # for make the window maximize or open

Button1 = Button(tkWindow, text="Minimize", command=minimize1)
Button1.grid(row=2, column=6, padx=10, pady=20)  


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.