Skip to content

Commit

Permalink
Restore inheritance from CTkSlider
Browse files Browse the repository at this point in the history
  • Loading branch information
pozitronik committed Nov 7, 2024
1 parent 9bb76c2 commit e54a426
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sinner/gui/controls/FramePosition/SliderFramePosition.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from tkinter import Label, StringVar, Frame, X, TOP, NW, DISABLED, NORMAL, IntVar, Misc
from typing import Union, Callable, Any, Dict

from customtkinter import CTkSlider

from sinner.gui.controls.FramePosition.BaseFramePosition import BaseFramePosition
from sinner.gui.controls.FramePosition.SliderWithProgress import SliderWithProgress


class SliderFramePosition(BaseFramePosition, SliderWithProgress):
class SliderFramePosition(BaseFramePosition, CTkSlider):
_container: Frame
_position_label: Label
_current_position: StringVar
Expand All @@ -16,21 +16,21 @@ def __init__(self, master: Misc | None, **kwargs): # type: ignore[no-untyped-de
self._container = Frame(master, borderwidth=2)
self._current_position = StringVar()
self._position_label = Label(master)
SliderWithProgress.__init__(self, self._container, **kwargs)
CTkSlider.__init__(self, self._container, **kwargs)
self._position_label.configure(textvariable=self._current_position)
self.update_position()

def pack(self, **kwargs: Dict[str, Any]) -> Any:
self._container.pack(fill=X)
result = SliderWithProgress.pack(self, **kwargs)
result = CTkSlider.pack(self, **kwargs)
self._position_label.pack(anchor=NW, side=TOP, expand=False, fill=X, after=self)
return result

def pack_forget(self) -> Any:
self._container.pack_forget()

def _clicked(self, event: Any | None = None) -> None:
SliderWithProgress._clicked(self, event)
CTkSlider._clicked(self, event)
self.update_position()

def set(self, output_value: int, from_variable_callback: bool = False) -> None:
Expand Down Expand Up @@ -86,7 +86,7 @@ def container(self) -> Frame:
return self._container

def disable(self) -> None:
SliderWithProgress.configure(self, True, state=DISABLED)
CTkSlider.configure(self, True, state=DISABLED)

def enable(self) -> None:
SliderWithProgress.configure(self, True, state=NORMAL)
CTkSlider.configure(self, True, state=NORMAL)

0 comments on commit e54a426

Please sign in to comment.