-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdlt.py
More file actions
48 lines (35 loc) · 955 Bytes
/
dlt.py
File metadata and controls
48 lines (35 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# This will import all the widgets
# and modules which are available in
# tkinter and ttk module
from tkinter import *
from tkinter.ttk import *
# creates a Tk() object
master = Tk()
# sets the geometry of main
# root window
master.geometry("200x200")
# function to open a new window
# on a button click
def openNewWindow():
# Toplevel object which will
# be treated as a new window
newWindow = Toplevel(master)
# sets the title of the
# Toplevel widget
newWindow.title("New Window")
# sets the geometry of toplevel
newWindow.geometry("200x200")
# A Label widget to show in toplevel
Label(newWindow,
text ="This is a new window").pack()
label = Label(master,
text ="This is the main window")
label.pack(pady = 10)
# a button widget which will open a
# new window on button click
btn = Button(master,
text ="Click to open a new window",
command = openNewWindow)
btn.pack(pady = 10)
# mainloop, runs infinitely
mainloop()