In this video I’ll show you how to use buttons in Custom Tkinter.

Buttons in CustomTkinter are quite a bit different than in regular Tkinter.

You have many more attributes that allow you to customize the button in many way, and we’ll talk about all of them in this video.

Python Code: ctk_button.py
(Github Code)


from tkinter import *
import customtkinter

# Set the theme and color options
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 Buttons')
root.iconbitmap('images/codemy.ico')
root.geometry('600x350')

def hello():
	my_label.configure(text=my_button.cget("text"))



my_button = customtkinter.CTkButton(root, 
	text="Hello World!!!", 
	command=hello,
	height=100,
	width=200,
	font=("Helvetica", 24),
	text_color="black",
	fg_color="red",
	hover_color="green",
	corner_radius=50,
	bg_color="white",
	border_width=10,
	border_color="yellow",
	state="normal")
my_button.pack(pady=80)

my_label = customtkinter.CTkLabel(root, text="")
my_label.pack(pady=20)




root.mainloop()

John Elder

John is the CEO of Codemy.com where he teaches over 100,000 students how to code! He founded one of the Internet's earliest advertising networks and sold it to a publicly company at the height of the first dot com boom. After that he developed the award-winning Submission-Spider search engine submission software that's been used by over 3 million individuals, businesses, and governments in over 42 countries. He's written several Amazon #1 best selling books on coding, and runs a popular Youtube coding channel.

View all posts

Add comment

Your email address will not be published. Required fields are marked *

John Elder

John is the CEO of Codemy.com where he teaches over 100,000 students how to code! He founded one of the Internet's earliest advertising networks and sold it to a publicly company at the height of...