File tree 1 file changed +38
-0
lines changed
1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ #imports
2
+ import tkinter as tk
3
+ from tkinter import *
4
+
5
+ root = tk .Tk ()
6
+
7
+ #makes the text box widget you can type in it plus add text to display and scroll through it
8
+ S = tk .Scrollbar (root )
9
+ T = tk .Text (root , height = 4 , width = 50 )
10
+ S .pack (side = tk .RIGHT , fill = tk .Y )
11
+ T .pack (side = tk .LEFT , fill = tk .Y )
12
+ S .config (command = T .yview )
13
+ T .config (yscrollcommand = S .set )
14
+ quote = " "
15
+ T .insert (tk .END , quote )
16
+
17
+ #makes the dropdown widgets
18
+ def show ():
19
+ label .config (text = clicked .get ())
20
+
21
+ options = [
22
+ "flinching" ,
23
+ "crash" ,
24
+ "jaywalking" ,
25
+ "distracted"
26
+ ]
27
+
28
+ clicked = StringVar (root )
29
+ clicked .set ("choose" )
30
+ drop = OptionMenu ( root , clicked , * options )
31
+ drop .pack ()
32
+ button = Button ( root , text = "your label" , command = show ).pack ()
33
+ label = Label ( root , text = " " )
34
+ label .pack ()
35
+
36
+ root .mainloop ()
37
+
38
+
You can’t perform that action at this time.
0 commit comments