-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathctk_scroll.py
53 lines (32 loc) · 1.03 KB
/
ctk_scroll.py
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
49
50
51
52
53
from tkinter import *
import customtkinter
customtkinter.set_appearance_mode("dark") # Modes: system (default), light, dark
customtkinter.set_default_color_theme("dark-blue") # Themes: blue (default), dark-blue, green
#root = Tk()
root = customtkinter.CTk()
root.title('Tkinter.com - Custom Tkinter Scrollable Frame!')
root.iconbitmap('images/codemy.ico')
root.geometry('700x300')
# Create a scrollable frame
my_frame = customtkinter.CTkScrollableFrame(root,
orientation="vertical",
width=300,
height=200,
label_text="Hello World!",
label_fg_color="blue",
label_text_color="yellow",
label_font=("Helvetica", 18),
label_anchor = "center", # "w", # n, ne, e, se, s, sw, w, nw, center
border_width=3,
border_color="green",
fg_color="red",
scrollbar_fg_color="yellow",
scrollbar_button_color="pink",
scrollbar_button_hover_color = "blue",
corner_radius = 20,
)
my_frame.pack(pady=40)
# for loop for buttons
for x in range(20):
customtkinter.CTkButton(my_frame, text="This is a Button!!").pack(pady=10)
root.mainloop()