mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
created image example
This commit is contained in:
@ -118,13 +118,16 @@ class CTkButton(CTkBaseClass):
|
||||
if self._text_label is not None:
|
||||
self._text_label.configure(font=self._apply_font_scaling(self._font))
|
||||
|
||||
if self._image_label is not None:
|
||||
self._update_image()
|
||||
self._update_image()
|
||||
|
||||
self._canvas.configure(width=self._apply_widget_scaling(self._desired_width),
|
||||
height=self._apply_widget_scaling(self._desired_height))
|
||||
self._draw(no_color_updates=True)
|
||||
|
||||
def _set_appearance_mode(self, mode_string):
|
||||
super()._set_appearance_mode(mode_string)
|
||||
self._update_image()
|
||||
|
||||
def _set_dimensions(self, width: int = None, height: int = None):
|
||||
super()._set_dimensions(width, height)
|
||||
|
||||
|
@ -101,8 +101,13 @@ class CTkLabel(CTkBaseClass):
|
||||
self._label.configure(wraplength=self._apply_widget_scaling(self._wraplength))
|
||||
|
||||
self._create_grid()
|
||||
self._update_image()
|
||||
self._draw(no_color_updates=True)
|
||||
|
||||
def _set_appearance_mode(self, mode_string):
|
||||
super()._set_appearance_mode(mode_string)
|
||||
self._update_image()
|
||||
|
||||
def _set_dimensions(self, width=None, height=None):
|
||||
super()._set_dimensions(width, height)
|
||||
|
||||
@ -165,9 +170,6 @@ class CTkLabel(CTkBaseClass):
|
||||
|
||||
self._canvas.configure(bg=self._apply_appearance_mode(self._bg_color))
|
||||
|
||||
if self._image is not None:
|
||||
self._update_image()
|
||||
|
||||
def configure(self, require_redraw=False, **kwargs):
|
||||
if "corner_radius" in kwargs:
|
||||
self._corner_radius = kwargs.pop("corner_radius")
|
||||
|
Reference in New Issue
Block a user