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 CTkProgressBar(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 destroy(self):
|
||||
if self.variable is not None:
|
||||
self.variable.trace_remove("write", self.variable_callback_name)
|
||||
@@ -159,6 +166,14 @@ class CTkProgressBar(CTkBaseClass):
|
||||
|
||||
del kwargs["variable"]
|
||||
|
||||
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"]
|
||||
|
||||
super().configure(*args, **kwargs)
|
||||
|
||||
if require_redraw is True:
|
||||
|
||||
Reference in New Issue
Block a user