TomSchimansky / CustomTkinter

A modern and customizable python UI-library based on Tkinter
MIT License
11.32k stars 1.07k forks source link

The image does not fill the button entirely #2459

Open Betrayal5414 opened 3 months ago

Betrayal5414 commented 3 months ago

can we fill a button entirely with an image?

# Images
self.IMG = ctk.CTkImage(light_image=Image.open("images/btn-1.png"), size=(140, 40))

# Buttons
self.btn_p1 = ctk.CTkButton(self, image=self.IMG, text="", width=140, height=40)
self.btn_p2 = ctk.CTkButton(self, image=self.IMG, text="", width=140, height=40)
self.btn_p3 = ctk.CTkButton(self, image=self.IMG, text="", width=140, height=40)

Exemple : button

My image doesn't completely fill the button. We see it when we the button is hover

dipeshSam commented 3 months ago

Either use CTkLabel or set hover=False to CTkButton constructor.