Tkinter GUI Programming
Examples on Tkinter
Connect Forms in Tkinter
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.
Create Login Form (First Page ):
import tkinter as tk
from tkinter import Entry
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()
Create Second Page Registration Page:
Complete code with First page and registration page.
(Registration page opens when we click on register button).
import tkinter as tk
from tkinter import Entry
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():
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
Tutorials
C is a very powerful and widely used language. It is used in many scientific programming situations. It forms (or is the basis for) the core of the modern languages Java and C++. It allows you access to the bare bones of your computer.C++ is used for operating systems, games, embedded software, autonomous cars and medical technology, as well as many other applications. Don't forget to visit this section...
Video/ C Introduction
Watch video in full size