CTkScrollableDropdownPP 2.0.2__tar.gz → 2.0.3__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.
- {ctkscrollabledropdownpp-2.0.2 → ctkscrollabledropdownpp-2.0.3}/CTkScrollableDropdownPP/ctk_scrollable_dropdown.py +10 -14
- {ctkscrollabledropdownpp-2.0.2 → ctkscrollabledropdownpp-2.0.3}/CTkScrollableDropdownPP.egg-info/PKG-INFO +16 -8
- {ctkscrollabledropdownpp-2.0.2 → ctkscrollabledropdownpp-2.0.3}/PKG-INFO +16 -8
- {ctkscrollabledropdownpp-2.0.2 → ctkscrollabledropdownpp-2.0.3}/README.md +15 -7
- {ctkscrollabledropdownpp-2.0.2 → ctkscrollabledropdownpp-2.0.3}/pyproject.toml +1 -1
- {ctkscrollabledropdownpp-2.0.2 → ctkscrollabledropdownpp-2.0.3}/CTkScrollableDropdownPP/__init__.py +0 -0
- {ctkscrollabledropdownpp-2.0.2 → ctkscrollabledropdownpp-2.0.3}/CTkScrollableDropdownPP.egg-info/SOURCES.txt +0 -0
- {ctkscrollabledropdownpp-2.0.2 → ctkscrollabledropdownpp-2.0.3}/CTkScrollableDropdownPP.egg-info/dependency_links.txt +0 -0
- {ctkscrollabledropdownpp-2.0.2 → ctkscrollabledropdownpp-2.0.3}/CTkScrollableDropdownPP.egg-info/requires.txt +0 -0
- {ctkscrollabledropdownpp-2.0.2 → ctkscrollabledropdownpp-2.0.3}/CTkScrollableDropdownPP.egg-info/top_level.txt +0 -0
- {ctkscrollabledropdownpp-2.0.2 → ctkscrollabledropdownpp-2.0.3}/LICENSE +0 -0
- {ctkscrollabledropdownpp-2.0.2 → ctkscrollabledropdownpp-2.0.3}/setup.cfg +0 -0
|
@@ -4,11 +4,11 @@ import re
|
|
|
4
4
|
|
|
5
5
|
class CTkScrollableDropdown(customtkinter.CTkToplevel):
|
|
6
6
|
|
|
7
|
-
def __init__(self, attach, x=None, y=None, button_color=None, height: int =
|
|
7
|
+
def __init__(self, attach, x=None, y=None, button_color=None, height: int = None, width: int = None,
|
|
8
8
|
fg_color=None, button_height: int = 20, justify="center", scrollbar_button_color=None,
|
|
9
9
|
scrollbar=True, scrollbar_button_hover_color=None, frame_border_width=0, values=[],
|
|
10
10
|
command=None, image_values=[], alpha: float = 0.95, frame_corner_radius=20, double_click=False,
|
|
11
|
-
|
|
11
|
+
frame_border_color=None, text_color=None, autocomplete=False,
|
|
12
12
|
hover_color=None, pagination: bool = True, items_per_page: int = 50,
|
|
13
13
|
groups=None, **button_kwargs):
|
|
14
14
|
super().__init__(master=attach.winfo_toplevel(), takefocus=1)
|
|
@@ -139,12 +139,14 @@ class CTkScrollableDropdown(customtkinter.CTkToplevel):
|
|
|
139
139
|
else:
|
|
140
140
|
self.button_container = self.frame
|
|
141
141
|
self.dummy_entry = customtkinter.CTkEntry(self.frame, fg_color="transparent", border_width=0, height=1, width=1)
|
|
142
|
-
self.
|
|
143
|
-
|
|
142
|
+
self.is_height = bool(height)
|
|
143
|
+
if height is None:
|
|
144
|
+
self.height_new = attach.winfo_toplevel().winfo_height()
|
|
145
|
+
else:
|
|
146
|
+
self.height_new = height
|
|
144
147
|
self.width = width
|
|
145
148
|
self.command = command
|
|
146
149
|
self.fade = False
|
|
147
|
-
self.resize = resize
|
|
148
150
|
self.autocomplete = autocomplete
|
|
149
151
|
self.var_update = customtkinter.StringVar()
|
|
150
152
|
self.appear = True
|
|
@@ -342,13 +344,8 @@ class CTkScrollableDropdown(customtkinter.CTkToplevel):
|
|
|
342
344
|
current_y_pos = self.winfo_y()
|
|
343
345
|
self.x_pos = self.attach.winfo_rootx() if self.x is None else self.x + self.attach.winfo_rootx()
|
|
344
346
|
self.width_new = self.attach.winfo_width() if self.width is None else self.width
|
|
345
|
-
if self.
|
|
346
|
-
|
|
347
|
-
if self.pagination:
|
|
348
|
-
displayed_items = min(displayed_items, self.items_per_page)
|
|
349
|
-
base_height = 50 if self.pagination else 35
|
|
350
|
-
items_height = displayed_items * self.button_height
|
|
351
|
-
self.height_new = items_height + base_height
|
|
347
|
+
if not self.is_height:
|
|
348
|
+
self.height_new = self.attach.winfo_toplevel().winfo_height()
|
|
352
349
|
screen_height = self.winfo_screenheight()
|
|
353
350
|
dropdown_bottom = self.attach.winfo_rooty() + self.height_new
|
|
354
351
|
if dropdown_bottom > screen_height:
|
|
@@ -472,8 +469,7 @@ class CTkScrollableDropdown(customtkinter.CTkToplevel):
|
|
|
472
469
|
if self.old_kwargs == kwargs:
|
|
473
470
|
return
|
|
474
471
|
if "height" in kwargs:
|
|
475
|
-
self.
|
|
476
|
-
self.height_new = self.height
|
|
472
|
+
self.height_new = kwargs.pop("height")
|
|
477
473
|
if "alpha" in kwargs:
|
|
478
474
|
self.alpha = kwargs.pop("alpha")
|
|
479
475
|
if "width" in kwargs:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: CTkScrollableDropdownPP
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.3
|
|
4
4
|
Summary: Enhanced CTkScrollableDropdown with pagination, search and groups support
|
|
5
5
|
Author: PLauncher-Team, Akash Bora
|
|
6
6
|
License: MIT
|
|
@@ -39,22 +39,30 @@ pip install ctkscrollabledropdownpp
|
|
|
39
39
|
|
|
40
40
|
```python
|
|
41
41
|
import customtkinter as ctk
|
|
42
|
-
from
|
|
42
|
+
from CTkScrollableDropdownPP import CTkScrollableDropdown
|
|
43
43
|
|
|
44
44
|
app = ctk.CTk()
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
app.geometry("400x300")
|
|
46
|
+
|
|
47
|
+
combobox = ctk.CTkComboBox(
|
|
48
|
+
master=app,
|
|
49
|
+
values=[],
|
|
50
|
+
width=200,
|
|
51
|
+
height=30
|
|
52
|
+
)
|
|
53
|
+
combobox.pack(pady=50)
|
|
47
54
|
|
|
48
55
|
values = [f"Item {i}" for i in range(1, 101)]
|
|
49
56
|
|
|
50
57
|
dropdown = CTkScrollableDropdown(
|
|
51
|
-
attach=
|
|
58
|
+
attach=combobox,
|
|
52
59
|
values=values,
|
|
53
60
|
command=lambda v: print("Selected:", v),
|
|
54
|
-
items_per_page=20,
|
|
55
|
-
pagination=True,
|
|
56
61
|
autocomplete=True,
|
|
57
|
-
groups=[
|
|
62
|
+
groups=[
|
|
63
|
+
('1-50', r'^Item ([1-9]|[1-4][0-9]|50)$'),
|
|
64
|
+
('Others', '__OTHERS__')
|
|
65
|
+
],
|
|
58
66
|
)
|
|
59
67
|
|
|
60
68
|
app.mainloop()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: CTkScrollableDropdownPP
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.3
|
|
4
4
|
Summary: Enhanced CTkScrollableDropdown with pagination, search and groups support
|
|
5
5
|
Author: PLauncher-Team, Akash Bora
|
|
6
6
|
License: MIT
|
|
@@ -39,22 +39,30 @@ pip install ctkscrollabledropdownpp
|
|
|
39
39
|
|
|
40
40
|
```python
|
|
41
41
|
import customtkinter as ctk
|
|
42
|
-
from
|
|
42
|
+
from CTkScrollableDropdownPP import CTkScrollableDropdown
|
|
43
43
|
|
|
44
44
|
app = ctk.CTk()
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
app.geometry("400x300")
|
|
46
|
+
|
|
47
|
+
combobox = ctk.CTkComboBox(
|
|
48
|
+
master=app,
|
|
49
|
+
values=[],
|
|
50
|
+
width=200,
|
|
51
|
+
height=30
|
|
52
|
+
)
|
|
53
|
+
combobox.pack(pady=50)
|
|
47
54
|
|
|
48
55
|
values = [f"Item {i}" for i in range(1, 101)]
|
|
49
56
|
|
|
50
57
|
dropdown = CTkScrollableDropdown(
|
|
51
|
-
attach=
|
|
58
|
+
attach=combobox,
|
|
52
59
|
values=values,
|
|
53
60
|
command=lambda v: print("Selected:", v),
|
|
54
|
-
items_per_page=20,
|
|
55
|
-
pagination=True,
|
|
56
61
|
autocomplete=True,
|
|
57
|
-
groups=[
|
|
62
|
+
groups=[
|
|
63
|
+
('1-50', r'^Item ([1-9]|[1-4][0-9]|50)$'),
|
|
64
|
+
('Others', '__OTHERS__')
|
|
65
|
+
],
|
|
58
66
|
)
|
|
59
67
|
|
|
60
68
|
app.mainloop()
|
|
@@ -22,22 +22,30 @@ pip install ctkscrollabledropdownpp
|
|
|
22
22
|
|
|
23
23
|
```python
|
|
24
24
|
import customtkinter as ctk
|
|
25
|
-
from
|
|
25
|
+
from CTkScrollableDropdownPP import CTkScrollableDropdown
|
|
26
26
|
|
|
27
27
|
app = ctk.CTk()
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
app.geometry("400x300")
|
|
29
|
+
|
|
30
|
+
combobox = ctk.CTkComboBox(
|
|
31
|
+
master=app,
|
|
32
|
+
values=[],
|
|
33
|
+
width=200,
|
|
34
|
+
height=30
|
|
35
|
+
)
|
|
36
|
+
combobox.pack(pady=50)
|
|
30
37
|
|
|
31
38
|
values = [f"Item {i}" for i in range(1, 101)]
|
|
32
39
|
|
|
33
40
|
dropdown = CTkScrollableDropdown(
|
|
34
|
-
attach=
|
|
41
|
+
attach=combobox,
|
|
35
42
|
values=values,
|
|
36
43
|
command=lambda v: print("Selected:", v),
|
|
37
|
-
items_per_page=20,
|
|
38
|
-
pagination=True,
|
|
39
44
|
autocomplete=True,
|
|
40
|
-
groups=[
|
|
45
|
+
groups=[
|
|
46
|
+
('1-50', r'^Item ([1-9]|[1-4][0-9]|50)$'),
|
|
47
|
+
('Others', '__OTHERS__')
|
|
48
|
+
],
|
|
41
49
|
)
|
|
42
50
|
|
|
43
51
|
app.mainloop()
|
{ctkscrollabledropdownpp-2.0.2 → ctkscrollabledropdownpp-2.0.3}/CTkScrollableDropdownPP/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|