pygui_simple 0.5.1__tar.gz → 0.5.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygui_simple
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: A simple gui library
5
5
  Author: Youchee
6
6
  Author-email: Youchee <youchi.xu@live.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pygui_simple"
3
- version = "0.5.1"
3
+ version = "0.5.2"
4
4
  description = "A simple gui library"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -344,6 +344,7 @@ class SlideSwitchCtrl(tkControl):
344
344
  # Exit if no state change needed
345
345
  if state == self._state:
346
346
  return
347
+ self._state = state
347
348
 
348
349
  # Animate to new state or set directly
349
350
  if animate:
@@ -356,7 +357,7 @@ class SlideSwitchCtrl(tkControl):
356
357
  self._on_state_changed(state)
357
358
 
358
359
  def _on_state_changed(self, state: bool):
359
- self._state = state
360
+ # self._state = state
360
361
  # Trigger callback if state changed
361
362
  if self._callback:
362
363
  self._callback(state)
@@ -797,13 +797,13 @@ class tkWM(Generic[T], Widget):
797
797
 
798
798
  # TODO: auto scrollable or not
799
799
  class DialogCtrl(Dialog):
800
- def __init__(self, app: tkWin, dlg_cfg: et.Element):
800
+ def __init__(self, app: WinBasic, dlg_cfg: et.Element):
801
801
  attr_dict = dlg_cfg.attrib
802
802
  super().__init__(attr_dict.get("text", ""), int(attr_dict["Width"]), int(attr_dict["Height"]), app)
803
803
  # options: dict[str, Any] = {}
804
804
  # if "options" in attr_dict:
805
805
  # options = eval(attr_dict["options"])
806
- self._parent: tk.Tk | tk.Toplevel = app.win
806
+ self._parent: tk.Tk | tk.Toplevel = cast(tk.Tk, app.win)
807
807
  # self._owner: Dialog | None = None
808
808
  # self._xx: int = 0
809
809
  # self._yy: int = 0
@@ -1056,6 +1056,7 @@ class tkWin(WinBasic):
1056
1056
  return 1.0 # 异常时使用默认值
1057
1057
 
1058
1058
  @property
1059
+ @override
1059
1060
  def win(self):
1060
1061
  return self._win
1061
1062
 
@@ -219,6 +219,10 @@ class WinBasic(Container, metaclass=abc.ABCMeta):
219
219
  def create_window(self):
220
220
  pass
221
221
 
222
+ @property
223
+ def win(self) -> object:
224
+ pass
225
+
222
226
  def create_xml(self, tag: str, attr_dict: dict[str, str], root: et.Element | None = None) -> et.Element:
223
227
  if root is not None:
224
228
  item_xml = et.SubElement(root, tag)
File without changes
File without changes