Skip to content

Commit 5a824e4

Browse files
feat Python Tkinter How To Use The Message Widget For Blocks of Text COMPLETE
Python Tkinter How To Use The Message Widget For Blocks of Text COMPLETE Reseolver: # see also: #
1 parent 4edae69 commit 5a824e4

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

Python Tkinter How To Use The Message Widget For Blocks of Text/HowToUseTheMessageWidgetForBlocksofText.py

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,44 @@
77
root = Tk()
88
root.title("Python Tkinter How To Use The Message Widget For Blocks of Text")
99
root.iconbitmap("Python Tkinter How To Use The Message Widget For Blocks of Text/icons/hulk.ico")
10-
root.geometry("500x400")
10+
root.geometry("500x800")
11+
12+
def change():
13+
my_message.config(text="And now something complety defferent!")
14+
15+
# First One
16+
frame1 = LabelFrame(root, text="Left Justified")
17+
frame1.pack(pady=20)
18+
19+
my_message = Message(frame1, text="This is some \n long text i am typing so that we can lok at it, isn look ",
20+
font=("Helvetica", 18),
21+
aspect=150,
22+
justify=LEFT)
23+
my_message.pack(pady=10, padx=10)
24+
25+
# Seconds One
26+
frame2 = LabelFrame(root, text="Right Justified")
27+
frame2.pack(pady=20)
28+
29+
my_message2 = Message(frame2, text="This is some \n long text i am typing so that we can lok at it, isn look ",
30+
font=("Helvetica", 18),
31+
aspect=150,
32+
justify=RIGHT)
33+
my_message2.pack(pady=10, padx=10)
34+
35+
# Thrird One
36+
frame3 = LabelFrame(root, text="Center Justified")
37+
frame3.pack(pady=20)
38+
39+
my_message3 = Message(frame3, text="This is some \n long text i am typing so that we can lok at it, isn look ",
40+
font=("Helvetica", 18),
41+
aspect=150,
42+
justify=CENTER)
43+
my_message3.pack(pady=10, padx=10)
44+
45+
# Button
46+
my_button = Button(root, text="Change Text", command=change)
47+
my_button.pack(pady=20)
1148

1249

1350
root.mainloop()

0 commit comments

Comments
 (0)