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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygui_simple
3
- Version: 0.5.0
3
+ Version: 0.5.1
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.0"
3
+ version = "0.5.1"
4
4
  description = "A simple gui library"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -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