Click Here

Working With Multiple Forms

Using python Tkinter we can connect multiple forms . eg. If user enters the correct login details(username & password) then it open the next main menu screen.

How to connect forms in Tkinter:

import tkinter as tk
from tkinter import Entry
# Next Form which open when we click on the register button
def register ():
window = tk.Tk()
window.title("GUI")
label = tk.Label(window, text="Enter Username").pack()
#u=StringVar()
global username
global password
username=Entry(window)
#print(u)
username.pack()
label = tk.Label(window, text="Enter password").pack()
password=Entry(window,show='*')
password.pack()
button3=tk.Button(window,
text="OK",
command=ok)
button3.pack(side=tk.LEFT)
button4=tk.Button(window,
text="Cancel",
command=quit)
button4.pack(side=tk.LEFT)
def ok():

print("code here to click on Ok button in register page")

root = tk.Tk()
frame = tk.Frame(root)
frame.pack()

button1 = tk.Button(frame,
text="Login",
fg="blue")

button1.pack(side=tk.LEFT)
button2 = tk.Button(frame,
text="Register",
command=register)
button2.pack(side=tk.LEFT)

root.mainloop()
Click Here

Video/ C Introduction

Watch video in full size