mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
added configurable dimensions to some widgets
This commit is contained in:
@@ -81,6 +81,13 @@ class CTkEntry(CTkBaseClass):
|
||||
self.canvas.configure(width=self.apply_widget_scaling(self.desired_width), height=self.apply_widget_scaling(self.desired_height))
|
||||
self.draw()
|
||||
|
||||
def set_dimensions(self, width=None, height=None):
|
||||
super().set_dimensions(width, height)
|
||||
|
||||
self.canvas.configure(width=self.apply_widget_scaling(self.desired_width),
|
||||
height=self.apply_widget_scaling(self.desired_height))
|
||||
self.draw()
|
||||
|
||||
def set_placeholder(self, event=None):
|
||||
if self.placeholder_text is not None:
|
||||
if not self.placeholder_text_active and self.entry.get() == "":
|
||||
@@ -181,6 +188,14 @@ class CTkEntry(CTkBaseClass):
|
||||
del kwargs["corner_radius"]
|
||||
require_redraw = True
|
||||
|
||||
if "width" in kwargs:
|
||||
self.set_dimensions(width=kwargs["width"])
|
||||
del kwargs["width"]
|
||||
|
||||
if "height" in kwargs:
|
||||
self.set_dimensions(height=kwargs["height"])
|
||||
del kwargs["height"]
|
||||
|
||||
if "placeholder_text" in kwargs:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user