mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
readme changed
This commit is contained in:
parent
83421abcb5
commit
df05fa3a81
12
Readme.md
12
Readme.md
@ -139,6 +139,18 @@ hover_color | hover color, tuple: (light_color, dark_color) or single color
|
|||||||
text_color | text color, tuple: (light_color, dark_color) or single color
|
text_color | text color, tuple: (light_color, dark_color) or single color
|
||||||
text_font | button text font, tuple: (font_name, size)
|
text_font | button text font, tuple: (font_name, size)
|
||||||
hover | enable/disable hover effect: True, False
|
hover | enable/disable hover effect: True, False
|
||||||
|
image | put an image on the button, removes the text, must be class PhotoImage
|
||||||
|
|
||||||
|
CTkButton Methods:
|
||||||
|
```python
|
||||||
|
CTkButton.set_text(new_text)
|
||||||
|
CTkButton.change_image(new_image)
|
||||||
|
CTkButton.configure_color(bg_color=new_bg_color,
|
||||||
|
fg_color=new_fg_color,
|
||||||
|
hover_color=new_hover_color,
|
||||||
|
text_color=new_text_color)
|
||||||
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### CTkLabel
|
### CTkLabel
|
||||||
|
@ -250,6 +250,13 @@ class CTkButton(tkinter.Frame):
|
|||||||
if self.text_label is not None:
|
if self.text_label is not None:
|
||||||
self.text_label.configure(text=self.text)
|
self.text_label.configure(text=self.text)
|
||||||
|
|
||||||
|
def change_image(self, image):
|
||||||
|
if self.image_label is not None:
|
||||||
|
self.image = image
|
||||||
|
self.image_label.configure(image=self.image)
|
||||||
|
else:
|
||||||
|
sys.stderr.write("ERROR (CTkButton): Cant change image because button has no image.")
|
||||||
|
|
||||||
def on_enter(self, event=0):
|
def on_enter(self, event=0):
|
||||||
for part in self.canvas_fg_parts:
|
for part in self.canvas_fg_parts:
|
||||||
if type(self.hover_color) == tuple and len(self.hover_color) == 2:
|
if type(self.hover_color) == tuple and len(self.hover_color) == 2:
|
||||||
|
Loading…
Reference in New Issue
Block a user