pygui_simple 0.5.0__tar.gz → 0.5.1__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.
- {pygui_simple-0.5.0 → pygui_simple-0.5.1}/PKG-INFO +1 -1
- {pygui_simple-0.5.0 → pygui_simple-0.5.1}/pyproject.toml +1 -1
- {pygui_simple-0.5.0 → pygui_simple-0.5.1}/src/pygui_simple/tkscrollpicker.py +6 -4
- {pygui_simple-0.5.0 → pygui_simple-0.5.1}/LICENSE +0 -0
- {pygui_simple-0.5.0 → pygui_simple-0.5.1}/README.md +0 -0
- {pygui_simple-0.5.0 → pygui_simple-0.5.1}/src/pygui_simple/__init__.py +0 -0
- {pygui_simple-0.5.0 → pygui_simple-0.5.1}/src/pygui_simple/py.typed +0 -0
- {pygui_simple-0.5.0 → pygui_simple-0.5.1}/src/pygui_simple/tkcalendar.py +0 -0
- {pygui_simple-0.5.0 → pygui_simple-0.5.1}/src/pygui_simple/tkcontrol.py +0 -0
- {pygui_simple-0.5.0 → pygui_simple-0.5.1}/src/pygui_simple/tkmatplot.py +0 -0
- {pygui_simple-0.5.0 → pygui_simple-0.5.1}/src/pygui_simple/tkslideswitch.py +0 -0
- {pygui_simple-0.5.0 → pygui_simple-0.5.1}/src/pygui_simple/tkwin.py +0 -0
- {pygui_simple-0.5.0 → pygui_simple-0.5.1}/src/pygui_simple/winbasic.py +0 -0
|
@@ -30,13 +30,16 @@ class ScrollPicker(tk.Frame, Generic[T]):
|
|
|
30
30
|
self._on_select: OnSelect[T] | None = on_select
|
|
31
31
|
if initial:
|
|
32
32
|
self._selected_data: T = initial
|
|
33
|
+
try:
|
|
34
|
+
self._index: int = self._val_list.index(initial)
|
|
35
|
+
except ValueError:
|
|
36
|
+
self._index = 0
|
|
33
37
|
else:
|
|
34
38
|
self._selected_data = val_list[0]
|
|
39
|
+
self._index = 0
|
|
35
40
|
|
|
36
41
|
self._background: str = cast(str, kwargs.get('background', 'white'))
|
|
37
42
|
|
|
38
|
-
self._index: int = 0
|
|
39
|
-
|
|
40
43
|
# 创建UI组件
|
|
41
44
|
self._create_widgets()
|
|
42
45
|
# 绑定鼠标事件
|
|
@@ -378,7 +381,7 @@ class TimeScrollPickerCtrl(tkControl):
|
|
|
378
381
|
self._selected_minute = int(now_list[1])
|
|
379
382
|
|
|
380
383
|
hour_list = list(range(0, 24))
|
|
381
|
-
print(hour_list)
|
|
384
|
+
# print(hour_list)
|
|
382
385
|
self._hour_scrollpicker: ScrollPicker[int] = ScrollPicker[int](self._frame,
|
|
383
386
|
hour_list, self._selected_hour,
|
|
384
387
|
self._on_hour_change,
|
|
@@ -461,7 +464,6 @@ class TimeScrollPickerDialog(Container):
|
|
|
461
464
|
selected_hour = int(now_list[0])
|
|
462
465
|
selected_minute = int(now_list[1])
|
|
463
466
|
|
|
464
|
-
# ttk.Label(self._frame, text=self._title, font=("SimHei", 12)).grid(row=0, column=0, pady=5)
|
|
465
467
|
ttk.Label(self._frame, text=self._title, font=("SimHei", 12)).pack()
|
|
466
468
|
|
|
467
469
|
self._time_scrollpicker_ctrl: TimeScrollPickerCtrl = TimeScrollPickerCtrl(self._frame, self,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|