CTkScrollableDropdownPP 2.0.4__tar.gz → 2.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.
- {ctkscrollabledropdownpp-2.0.4 → ctkscrollabledropdownpp-2.1}/CTkScrollableDropdownPP/ctk_scrollable_dropdown.py +24 -12
- ctkscrollabledropdownpp-2.1/CTkScrollableDropdownPP.egg-info/PKG-INFO +120 -0
- ctkscrollabledropdownpp-2.1/PKG-INFO +120 -0
- ctkscrollabledropdownpp-2.1/README.md +103 -0
- {ctkscrollabledropdownpp-2.0.4 → ctkscrollabledropdownpp-2.1}/pyproject.toml +1 -1
- ctkscrollabledropdownpp-2.0.4/CTkScrollableDropdownPP.egg-info/PKG-INFO +0 -71
- ctkscrollabledropdownpp-2.0.4/PKG-INFO +0 -71
- ctkscrollabledropdownpp-2.0.4/README.md +0 -54
- {ctkscrollabledropdownpp-2.0.4 → ctkscrollabledropdownpp-2.1}/CTkScrollableDropdownPP/__init__.py +0 -0
- {ctkscrollabledropdownpp-2.0.4 → ctkscrollabledropdownpp-2.1}/CTkScrollableDropdownPP.egg-info/SOURCES.txt +0 -0
- {ctkscrollabledropdownpp-2.0.4 → ctkscrollabledropdownpp-2.1}/CTkScrollableDropdownPP.egg-info/dependency_links.txt +0 -0
- {ctkscrollabledropdownpp-2.0.4 → ctkscrollabledropdownpp-2.1}/CTkScrollableDropdownPP.egg-info/requires.txt +0 -0
- {ctkscrollabledropdownpp-2.0.4 → ctkscrollabledropdownpp-2.1}/CTkScrollableDropdownPP.egg-info/top_level.txt +0 -0
- {ctkscrollabledropdownpp-2.0.4 → ctkscrollabledropdownpp-2.1}/LICENSE +0 -0
- {ctkscrollabledropdownpp-2.0.4 → ctkscrollabledropdownpp-2.1}/setup.cfg +0 -0
|
@@ -39,7 +39,7 @@ class CTkScrollableDropdown(customtkinter.CTkToplevel):
|
|
|
39
39
|
self.current_group = 0
|
|
40
40
|
self.font = font
|
|
41
41
|
self.groups = []
|
|
42
|
-
|
|
42
|
+
|
|
43
43
|
if groups is not None:
|
|
44
44
|
for g in groups:
|
|
45
45
|
if isinstance(g, (list, tuple)) and len(g) >= 2:
|
|
@@ -160,7 +160,11 @@ class CTkScrollableDropdown(customtkinter.CTkToplevel):
|
|
|
160
160
|
else:
|
|
161
161
|
self.justify = "c"
|
|
162
162
|
self.button_height = button_height
|
|
163
|
-
self.image_values =
|
|
163
|
+
self.image_values = image_values
|
|
164
|
+
self.value_to_image = {}
|
|
165
|
+
if image_values and len(image_values) == len(values):
|
|
166
|
+
for val, img in zip(values, image_values):
|
|
167
|
+
self.value_to_image[val] = img
|
|
164
168
|
self.resizable(width=False, height=False)
|
|
165
169
|
self.transient(self.master)
|
|
166
170
|
if double_click or isinstance(self.attach, customtkinter.CTkEntry) or isinstance(self.attach, customtkinter.CTkComboBox):
|
|
@@ -241,7 +245,7 @@ class CTkScrollableDropdown(customtkinter.CTkToplevel):
|
|
|
241
245
|
for i, value in enumerate(values_list):
|
|
242
246
|
if i in self.widgets:
|
|
243
247
|
btn, _ = self.widgets[i]
|
|
244
|
-
btn.configure(text=value, command=lambda v=value: self._attach_key_press(v))
|
|
248
|
+
btn.configure(text=value, command=lambda v=value: self._attach_key_press(v), image=self.value_to_image.get(value))
|
|
245
249
|
btn.pack(fill="x", pady=2, padx=(self.padding, 0))
|
|
246
250
|
self.widgets[i][1] = True
|
|
247
251
|
else:
|
|
@@ -254,7 +258,8 @@ class CTkScrollableDropdown(customtkinter.CTkToplevel):
|
|
|
254
258
|
fg_color=self.button_color,
|
|
255
259
|
text_color=self.text_color,
|
|
256
260
|
anchor=self.justify,
|
|
257
|
-
hover_color=self.hover_color
|
|
261
|
+
hover_color=self.hover_color,
|
|
262
|
+
image=self.value_to_image.get(value)
|
|
258
263
|
)
|
|
259
264
|
btn.pack(fill="x", pady=2, padx=(self.padding, 0))
|
|
260
265
|
self.widgets[i] = [btn, True]
|
|
@@ -449,7 +454,7 @@ class CTkScrollableDropdown(customtkinter.CTkToplevel):
|
|
|
449
454
|
index = len(self.values)
|
|
450
455
|
if index in self.widgets:
|
|
451
456
|
btn, _ = self.widgets[index]
|
|
452
|
-
btn.configure(text=value, command=lambda v=value: self._attach_key_press(v))
|
|
457
|
+
btn.configure(text=value, command=lambda v=value: self._attach_key_press(v), image=self.value_to_image.get(value))
|
|
453
458
|
btn.pack(fill="x", pady=2, padx=(self.padding, 0))
|
|
454
459
|
self.widgets[index][1] = True
|
|
455
460
|
else:
|
|
@@ -461,8 +466,9 @@ class CTkScrollableDropdown(customtkinter.CTkToplevel):
|
|
|
461
466
|
hover_color=self.hover_color,
|
|
462
467
|
anchor=self.justify,
|
|
463
468
|
command=lambda v=value: self._attach_key_press(v),
|
|
464
|
-
|
|
465
|
-
|
|
469
|
+
image=self.value_to_image.get(value),
|
|
470
|
+
width=0,
|
|
471
|
+
*kwargs)
|
|
466
472
|
btn.pack(fill="x", pady=2, padx=(self.padding, 0))
|
|
467
473
|
self.widgets[index] = [btn, True]
|
|
468
474
|
self.values.append(value)
|
|
@@ -556,11 +562,17 @@ class CTkScrollableDropdown(customtkinter.CTkToplevel):
|
|
|
556
562
|
self.current_group = 0
|
|
557
563
|
self.switch_group(self.current_group)
|
|
558
564
|
if "image_values" in kwargs:
|
|
559
|
-
|
|
560
|
-
self.image_values =
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
565
|
+
image_values_arg = kwargs.pop("image_values")
|
|
566
|
+
self.image_values = image_values_arg
|
|
567
|
+
self.value_to_image = {}
|
|
568
|
+
|
|
569
|
+
if image_values_arg and len(image_values_arg) == len(self.values):
|
|
570
|
+
for val, img in zip(self.values, image_values_arg):
|
|
571
|
+
self.value_to_image[val] = img
|
|
572
|
+
|
|
573
|
+
for key, (btn, visible) in self.widgets.items():
|
|
574
|
+
current_value = btn.cget("text")
|
|
575
|
+
btn.configure(image=self.value_to_image.get(current_value))
|
|
564
576
|
if "button_color" in kwargs:
|
|
565
577
|
bc = kwargs.pop("button_color")
|
|
566
578
|
for key in self.widgets:
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: CTkScrollableDropdownPP
|
|
3
|
+
Version: 2.1
|
|
4
|
+
Summary: Enhanced CTkScrollableDropdown with pagination, search and groups support
|
|
5
|
+
Author: PLauncher-Team, Akash Bora
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/PLauncher-Team/CTkScrollableDropdownPP
|
|
8
|
+
Project-URL: Original, https://github.com/Akascape/CTkScrollableDropdown
|
|
9
|
+
Keywords: customtkinter,dropdown,pagination,search,groups
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.8
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: customtkinter>=5.2.0
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# CTkScrollableDropdownPP
|
|
19
|
+
|
|
20
|
+
[](https://pepy.tech/projects/ctkscrollabledropdownpp)
|
|
21
|
+
|
|
22
|
+
**CTkScrollableDropdownPP** is an enhanced dropdown widget for CustomTkinter featuring pagination, live search, and grouping support.
|
|
23
|
+
|
|
24
|
+
> Based on the original [CTkScrollableDropdown](https://github.com/Akascape/CTkScrollableDropdown) project.
|
|
25
|
+
|
|
26
|
+
## Features
|
|
27
|
+
|
|
28
|
+
* Pagination for large lists
|
|
29
|
+
* Real-time filtering
|
|
30
|
+
* Grouped items (using regex or labels)
|
|
31
|
+
* Autocomplete on typing
|
|
32
|
+
* Fully customizable appearance
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install ctkscrollabledropdownpp
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Example
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
import customtkinter
|
|
44
|
+
from PIL import Image, ImageDraw
|
|
45
|
+
from CTkScrollableDropdownPP import CTkScrollableDropdown
|
|
46
|
+
import io
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def create_color_image(color, width=20, height=20):
|
|
50
|
+
"""Create an image of the specified color"""
|
|
51
|
+
img = Image.new('RGBA', (width, height), (0, 0, 0, 0))
|
|
52
|
+
draw = ImageDraw.Draw(img)
|
|
53
|
+
draw.rectangle((0, 0, width - 1, height - 1), fill=color)
|
|
54
|
+
img_bytes = io.BytesIO()
|
|
55
|
+
img.save(img_bytes, format='PNG')
|
|
56
|
+
img_bytes.seek(0)
|
|
57
|
+
return customtkinter.CTkImage(Image.open(img_bytes), size=(width, height))
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def create_number_image(number, width=20, height=20):
|
|
61
|
+
"""Create an image with a digit"""
|
|
62
|
+
img = Image.new('RGBA', (width, height), (0, 0, 0, 0))
|
|
63
|
+
draw = ImageDraw.Draw(img)
|
|
64
|
+
draw.rectangle((0, 0, width - 1, height - 1), fill="#FFFFFF")
|
|
65
|
+
draw.text((width // 2, height // 2), str(number), fill="#000000", anchor="mm")
|
|
66
|
+
img_bytes = io.BytesIO()
|
|
67
|
+
img.save(img_bytes, format='PNG')
|
|
68
|
+
img_bytes.seek(0)
|
|
69
|
+
return customtkinter.CTkImage(Image.open(img_bytes), size=(width, height))
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
# Create main window
|
|
73
|
+
root = customtkinter.CTk()
|
|
74
|
+
root.geometry("500x400")
|
|
75
|
+
|
|
76
|
+
# Create CTkComboBox
|
|
77
|
+
combobox = customtkinter.CTkComboBox(root, width=250)
|
|
78
|
+
combobox.pack(pady=50)
|
|
79
|
+
|
|
80
|
+
# Data for dropdown list
|
|
81
|
+
colors = {
|
|
82
|
+
"Red": "#FF0000",
|
|
83
|
+
"Green": "#00FF00",
|
|
84
|
+
"Blue": "#0000FF",
|
|
85
|
+
"Yellow": "#FFFF00",
|
|
86
|
+
"Orange": "#FFA500",
|
|
87
|
+
"Purple": "#800080",
|
|
88
|
+
"Pink": "#FFC0CB",
|
|
89
|
+
"Brown": "#A52A2A",
|
|
90
|
+
"Black": "#000000",
|
|
91
|
+
"White": "#FFFFFF"
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
numbers = [str(i) for i in range(10)] # Digits from 0 to 9
|
|
95
|
+
|
|
96
|
+
# Create lists of values and images
|
|
97
|
+
color_values = list(colors.keys())
|
|
98
|
+
color_images = [create_color_image(color_code) for color_code in colors.values()]
|
|
99
|
+
|
|
100
|
+
number_values = numbers
|
|
101
|
+
number_images = [create_number_image(num) for num in numbers]
|
|
102
|
+
|
|
103
|
+
# Combine all values and images
|
|
104
|
+
all_values = color_values + number_values
|
|
105
|
+
all_images = color_images + number_images
|
|
106
|
+
|
|
107
|
+
# Groups for sorting
|
|
108
|
+
groups = [
|
|
109
|
+
["Numbers", "^[0-9]$"],
|
|
110
|
+
["Colors", "__OTHERS__"]
|
|
111
|
+
]
|
|
112
|
+
|
|
113
|
+
# Create dropdown list
|
|
114
|
+
dropdown = CTkScrollableDropdown(attach=combobox, button_color="#2b2b2b", height=200, width=300, fg_color="#333333",
|
|
115
|
+
values=all_values, command=lambda value: print(f"Selected: {value}"),
|
|
116
|
+
image_values=all_images, text_color="#ffffff", hover_color="#3a3a3a",
|
|
117
|
+
font=("Arial", 12), groups=groups, items_per_page=10)
|
|
118
|
+
|
|
119
|
+
root.mainloop()
|
|
120
|
+
```
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: CTkScrollableDropdownPP
|
|
3
|
+
Version: 2.1
|
|
4
|
+
Summary: Enhanced CTkScrollableDropdown with pagination, search and groups support
|
|
5
|
+
Author: PLauncher-Team, Akash Bora
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/PLauncher-Team/CTkScrollableDropdownPP
|
|
8
|
+
Project-URL: Original, https://github.com/Akascape/CTkScrollableDropdown
|
|
9
|
+
Keywords: customtkinter,dropdown,pagination,search,groups
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.8
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: customtkinter>=5.2.0
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# CTkScrollableDropdownPP
|
|
19
|
+
|
|
20
|
+
[](https://pepy.tech/projects/ctkscrollabledropdownpp)
|
|
21
|
+
|
|
22
|
+
**CTkScrollableDropdownPP** is an enhanced dropdown widget for CustomTkinter featuring pagination, live search, and grouping support.
|
|
23
|
+
|
|
24
|
+
> Based on the original [CTkScrollableDropdown](https://github.com/Akascape/CTkScrollableDropdown) project.
|
|
25
|
+
|
|
26
|
+
## Features
|
|
27
|
+
|
|
28
|
+
* Pagination for large lists
|
|
29
|
+
* Real-time filtering
|
|
30
|
+
* Grouped items (using regex or labels)
|
|
31
|
+
* Autocomplete on typing
|
|
32
|
+
* Fully customizable appearance
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install ctkscrollabledropdownpp
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Example
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
import customtkinter
|
|
44
|
+
from PIL import Image, ImageDraw
|
|
45
|
+
from CTkScrollableDropdownPP import CTkScrollableDropdown
|
|
46
|
+
import io
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def create_color_image(color, width=20, height=20):
|
|
50
|
+
"""Create an image of the specified color"""
|
|
51
|
+
img = Image.new('RGBA', (width, height), (0, 0, 0, 0))
|
|
52
|
+
draw = ImageDraw.Draw(img)
|
|
53
|
+
draw.rectangle((0, 0, width - 1, height - 1), fill=color)
|
|
54
|
+
img_bytes = io.BytesIO()
|
|
55
|
+
img.save(img_bytes, format='PNG')
|
|
56
|
+
img_bytes.seek(0)
|
|
57
|
+
return customtkinter.CTkImage(Image.open(img_bytes), size=(width, height))
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def create_number_image(number, width=20, height=20):
|
|
61
|
+
"""Create an image with a digit"""
|
|
62
|
+
img = Image.new('RGBA', (width, height), (0, 0, 0, 0))
|
|
63
|
+
draw = ImageDraw.Draw(img)
|
|
64
|
+
draw.rectangle((0, 0, width - 1, height - 1), fill="#FFFFFF")
|
|
65
|
+
draw.text((width // 2, height // 2), str(number), fill="#000000", anchor="mm")
|
|
66
|
+
img_bytes = io.BytesIO()
|
|
67
|
+
img.save(img_bytes, format='PNG')
|
|
68
|
+
img_bytes.seek(0)
|
|
69
|
+
return customtkinter.CTkImage(Image.open(img_bytes), size=(width, height))
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
# Create main window
|
|
73
|
+
root = customtkinter.CTk()
|
|
74
|
+
root.geometry("500x400")
|
|
75
|
+
|
|
76
|
+
# Create CTkComboBox
|
|
77
|
+
combobox = customtkinter.CTkComboBox(root, width=250)
|
|
78
|
+
combobox.pack(pady=50)
|
|
79
|
+
|
|
80
|
+
# Data for dropdown list
|
|
81
|
+
colors = {
|
|
82
|
+
"Red": "#FF0000",
|
|
83
|
+
"Green": "#00FF00",
|
|
84
|
+
"Blue": "#0000FF",
|
|
85
|
+
"Yellow": "#FFFF00",
|
|
86
|
+
"Orange": "#FFA500",
|
|
87
|
+
"Purple": "#800080",
|
|
88
|
+
"Pink": "#FFC0CB",
|
|
89
|
+
"Brown": "#A52A2A",
|
|
90
|
+
"Black": "#000000",
|
|
91
|
+
"White": "#FFFFFF"
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
numbers = [str(i) for i in range(10)] # Digits from 0 to 9
|
|
95
|
+
|
|
96
|
+
# Create lists of values and images
|
|
97
|
+
color_values = list(colors.keys())
|
|
98
|
+
color_images = [create_color_image(color_code) for color_code in colors.values()]
|
|
99
|
+
|
|
100
|
+
number_values = numbers
|
|
101
|
+
number_images = [create_number_image(num) for num in numbers]
|
|
102
|
+
|
|
103
|
+
# Combine all values and images
|
|
104
|
+
all_values = color_values + number_values
|
|
105
|
+
all_images = color_images + number_images
|
|
106
|
+
|
|
107
|
+
# Groups for sorting
|
|
108
|
+
groups = [
|
|
109
|
+
["Numbers", "^[0-9]$"],
|
|
110
|
+
["Colors", "__OTHERS__"]
|
|
111
|
+
]
|
|
112
|
+
|
|
113
|
+
# Create dropdown list
|
|
114
|
+
dropdown = CTkScrollableDropdown(attach=combobox, button_color="#2b2b2b", height=200, width=300, fg_color="#333333",
|
|
115
|
+
values=all_values, command=lambda value: print(f"Selected: {value}"),
|
|
116
|
+
image_values=all_images, text_color="#ffffff", hover_color="#3a3a3a",
|
|
117
|
+
font=("Arial", 12), groups=groups, items_per_page=10)
|
|
118
|
+
|
|
119
|
+
root.mainloop()
|
|
120
|
+
```
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# CTkScrollableDropdownPP
|
|
2
|
+
|
|
3
|
+
[](https://pepy.tech/projects/ctkscrollabledropdownpp)
|
|
4
|
+
|
|
5
|
+
**CTkScrollableDropdownPP** is an enhanced dropdown widget for CustomTkinter featuring pagination, live search, and grouping support.
|
|
6
|
+
|
|
7
|
+
> Based on the original [CTkScrollableDropdown](https://github.com/Akascape/CTkScrollableDropdown) project.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
* Pagination for large lists
|
|
12
|
+
* Real-time filtering
|
|
13
|
+
* Grouped items (using regex or labels)
|
|
14
|
+
* Autocomplete on typing
|
|
15
|
+
* Fully customizable appearance
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install ctkscrollabledropdownpp
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Example
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
import customtkinter
|
|
27
|
+
from PIL import Image, ImageDraw
|
|
28
|
+
from CTkScrollableDropdownPP import CTkScrollableDropdown
|
|
29
|
+
import io
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def create_color_image(color, width=20, height=20):
|
|
33
|
+
"""Create an image of the specified color"""
|
|
34
|
+
img = Image.new('RGBA', (width, height), (0, 0, 0, 0))
|
|
35
|
+
draw = ImageDraw.Draw(img)
|
|
36
|
+
draw.rectangle((0, 0, width - 1, height - 1), fill=color)
|
|
37
|
+
img_bytes = io.BytesIO()
|
|
38
|
+
img.save(img_bytes, format='PNG')
|
|
39
|
+
img_bytes.seek(0)
|
|
40
|
+
return customtkinter.CTkImage(Image.open(img_bytes), size=(width, height))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def create_number_image(number, width=20, height=20):
|
|
44
|
+
"""Create an image with a digit"""
|
|
45
|
+
img = Image.new('RGBA', (width, height), (0, 0, 0, 0))
|
|
46
|
+
draw = ImageDraw.Draw(img)
|
|
47
|
+
draw.rectangle((0, 0, width - 1, height - 1), fill="#FFFFFF")
|
|
48
|
+
draw.text((width // 2, height // 2), str(number), fill="#000000", anchor="mm")
|
|
49
|
+
img_bytes = io.BytesIO()
|
|
50
|
+
img.save(img_bytes, format='PNG')
|
|
51
|
+
img_bytes.seek(0)
|
|
52
|
+
return customtkinter.CTkImage(Image.open(img_bytes), size=(width, height))
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# Create main window
|
|
56
|
+
root = customtkinter.CTk()
|
|
57
|
+
root.geometry("500x400")
|
|
58
|
+
|
|
59
|
+
# Create CTkComboBox
|
|
60
|
+
combobox = customtkinter.CTkComboBox(root, width=250)
|
|
61
|
+
combobox.pack(pady=50)
|
|
62
|
+
|
|
63
|
+
# Data for dropdown list
|
|
64
|
+
colors = {
|
|
65
|
+
"Red": "#FF0000",
|
|
66
|
+
"Green": "#00FF00",
|
|
67
|
+
"Blue": "#0000FF",
|
|
68
|
+
"Yellow": "#FFFF00",
|
|
69
|
+
"Orange": "#FFA500",
|
|
70
|
+
"Purple": "#800080",
|
|
71
|
+
"Pink": "#FFC0CB",
|
|
72
|
+
"Brown": "#A52A2A",
|
|
73
|
+
"Black": "#000000",
|
|
74
|
+
"White": "#FFFFFF"
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
numbers = [str(i) for i in range(10)] # Digits from 0 to 9
|
|
78
|
+
|
|
79
|
+
# Create lists of values and images
|
|
80
|
+
color_values = list(colors.keys())
|
|
81
|
+
color_images = [create_color_image(color_code) for color_code in colors.values()]
|
|
82
|
+
|
|
83
|
+
number_values = numbers
|
|
84
|
+
number_images = [create_number_image(num) for num in numbers]
|
|
85
|
+
|
|
86
|
+
# Combine all values and images
|
|
87
|
+
all_values = color_values + number_values
|
|
88
|
+
all_images = color_images + number_images
|
|
89
|
+
|
|
90
|
+
# Groups for sorting
|
|
91
|
+
groups = [
|
|
92
|
+
["Numbers", "^[0-9]$"],
|
|
93
|
+
["Colors", "__OTHERS__"]
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
# Create dropdown list
|
|
97
|
+
dropdown = CTkScrollableDropdown(attach=combobox, button_color="#2b2b2b", height=200, width=300, fg_color="#333333",
|
|
98
|
+
values=all_values, command=lambda value: print(f"Selected: {value}"),
|
|
99
|
+
image_values=all_images, text_color="#ffffff", hover_color="#3a3a3a",
|
|
100
|
+
font=("Arial", 12), groups=groups, items_per_page=10)
|
|
101
|
+
|
|
102
|
+
root.mainloop()
|
|
103
|
+
```
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: CTkScrollableDropdownPP
|
|
3
|
-
Version: 2.0.4
|
|
4
|
-
Summary: Enhanced CTkScrollableDropdown with pagination, search and groups support
|
|
5
|
-
Author: PLauncher-Team, Akash Bora
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/PLauncher-Team/CTkScrollableDropdownPP
|
|
8
|
-
Project-URL: Original, https://github.com/Akascape/CTkScrollableDropdown
|
|
9
|
-
Keywords: customtkinter,dropdown,pagination,search,groups
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Operating System :: OS Independent
|
|
12
|
-
Requires-Python: >=3.8
|
|
13
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
License-File: LICENSE
|
|
15
|
-
Requires-Dist: customtkinter>=5.2.0
|
|
16
|
-
Dynamic: license-file
|
|
17
|
-
|
|
18
|
-
# CTkScrollableDropdownPP
|
|
19
|
-
|
|
20
|
-
[](https://pepy.tech/projects/ctkscrollabledropdownpp)
|
|
21
|
-
|
|
22
|
-
**CTkScrollableDropdownPP** is an enhanced dropdown widget for CustomTkinter featuring pagination, live search, and grouping support.
|
|
23
|
-
|
|
24
|
-
> Based on the original [CTkScrollableDropdown](https://github.com/Akascape/CTkScrollableDropdown) project.
|
|
25
|
-
|
|
26
|
-
## Features
|
|
27
|
-
|
|
28
|
-
* Pagination for large lists
|
|
29
|
-
* Real-time filtering
|
|
30
|
-
* Grouped items (using regex or labels)
|
|
31
|
-
* Autocomplete on typing
|
|
32
|
-
* Fully customizable appearance
|
|
33
|
-
|
|
34
|
-
## Installation
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
pip install ctkscrollabledropdownpp
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Quick Start
|
|
41
|
-
|
|
42
|
-
```python
|
|
43
|
-
import customtkinter as ctk
|
|
44
|
-
from CTkScrollableDropdownPP import CTkScrollableDropdown
|
|
45
|
-
|
|
46
|
-
app = ctk.CTk()
|
|
47
|
-
app.geometry("400x300")
|
|
48
|
-
|
|
49
|
-
combobox = ctk.CTkComboBox(
|
|
50
|
-
master=app,
|
|
51
|
-
values=[],
|
|
52
|
-
width=200,
|
|
53
|
-
height=30
|
|
54
|
-
)
|
|
55
|
-
combobox.pack(pady=50)
|
|
56
|
-
|
|
57
|
-
values = [f"Item {i}" for i in range(1, 101)]
|
|
58
|
-
|
|
59
|
-
dropdown = CTkScrollableDropdown(
|
|
60
|
-
attach=combobox,
|
|
61
|
-
values=values,
|
|
62
|
-
command=lambda v: print("Selected:", v),
|
|
63
|
-
autocomplete=True,
|
|
64
|
-
groups=[
|
|
65
|
-
('1-50', r'^Item ([1-9]|[1-4][0-9]|50)$'),
|
|
66
|
-
('Others', '__OTHERS__')
|
|
67
|
-
],
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
app.mainloop()
|
|
71
|
-
```
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: CTkScrollableDropdownPP
|
|
3
|
-
Version: 2.0.4
|
|
4
|
-
Summary: Enhanced CTkScrollableDropdown with pagination, search and groups support
|
|
5
|
-
Author: PLauncher-Team, Akash Bora
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/PLauncher-Team/CTkScrollableDropdownPP
|
|
8
|
-
Project-URL: Original, https://github.com/Akascape/CTkScrollableDropdown
|
|
9
|
-
Keywords: customtkinter,dropdown,pagination,search,groups
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Operating System :: OS Independent
|
|
12
|
-
Requires-Python: >=3.8
|
|
13
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
License-File: LICENSE
|
|
15
|
-
Requires-Dist: customtkinter>=5.2.0
|
|
16
|
-
Dynamic: license-file
|
|
17
|
-
|
|
18
|
-
# CTkScrollableDropdownPP
|
|
19
|
-
|
|
20
|
-
[](https://pepy.tech/projects/ctkscrollabledropdownpp)
|
|
21
|
-
|
|
22
|
-
**CTkScrollableDropdownPP** is an enhanced dropdown widget for CustomTkinter featuring pagination, live search, and grouping support.
|
|
23
|
-
|
|
24
|
-
> Based on the original [CTkScrollableDropdown](https://github.com/Akascape/CTkScrollableDropdown) project.
|
|
25
|
-
|
|
26
|
-
## Features
|
|
27
|
-
|
|
28
|
-
* Pagination for large lists
|
|
29
|
-
* Real-time filtering
|
|
30
|
-
* Grouped items (using regex or labels)
|
|
31
|
-
* Autocomplete on typing
|
|
32
|
-
* Fully customizable appearance
|
|
33
|
-
|
|
34
|
-
## Installation
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
pip install ctkscrollabledropdownpp
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Quick Start
|
|
41
|
-
|
|
42
|
-
```python
|
|
43
|
-
import customtkinter as ctk
|
|
44
|
-
from CTkScrollableDropdownPP import CTkScrollableDropdown
|
|
45
|
-
|
|
46
|
-
app = ctk.CTk()
|
|
47
|
-
app.geometry("400x300")
|
|
48
|
-
|
|
49
|
-
combobox = ctk.CTkComboBox(
|
|
50
|
-
master=app,
|
|
51
|
-
values=[],
|
|
52
|
-
width=200,
|
|
53
|
-
height=30
|
|
54
|
-
)
|
|
55
|
-
combobox.pack(pady=50)
|
|
56
|
-
|
|
57
|
-
values = [f"Item {i}" for i in range(1, 101)]
|
|
58
|
-
|
|
59
|
-
dropdown = CTkScrollableDropdown(
|
|
60
|
-
attach=combobox,
|
|
61
|
-
values=values,
|
|
62
|
-
command=lambda v: print("Selected:", v),
|
|
63
|
-
autocomplete=True,
|
|
64
|
-
groups=[
|
|
65
|
-
('1-50', r'^Item ([1-9]|[1-4][0-9]|50)$'),
|
|
66
|
-
('Others', '__OTHERS__')
|
|
67
|
-
],
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
app.mainloop()
|
|
71
|
-
```
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# CTkScrollableDropdownPP
|
|
2
|
-
|
|
3
|
-
[](https://pepy.tech/projects/ctkscrollabledropdownpp)
|
|
4
|
-
|
|
5
|
-
**CTkScrollableDropdownPP** is an enhanced dropdown widget for CustomTkinter featuring pagination, live search, and grouping support.
|
|
6
|
-
|
|
7
|
-
> Based on the original [CTkScrollableDropdown](https://github.com/Akascape/CTkScrollableDropdown) project.
|
|
8
|
-
|
|
9
|
-
## Features
|
|
10
|
-
|
|
11
|
-
* Pagination for large lists
|
|
12
|
-
* Real-time filtering
|
|
13
|
-
* Grouped items (using regex or labels)
|
|
14
|
-
* Autocomplete on typing
|
|
15
|
-
* Fully customizable appearance
|
|
16
|
-
|
|
17
|
-
## Installation
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
pip install ctkscrollabledropdownpp
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Quick Start
|
|
24
|
-
|
|
25
|
-
```python
|
|
26
|
-
import customtkinter as ctk
|
|
27
|
-
from CTkScrollableDropdownPP import CTkScrollableDropdown
|
|
28
|
-
|
|
29
|
-
app = ctk.CTk()
|
|
30
|
-
app.geometry("400x300")
|
|
31
|
-
|
|
32
|
-
combobox = ctk.CTkComboBox(
|
|
33
|
-
master=app,
|
|
34
|
-
values=[],
|
|
35
|
-
width=200,
|
|
36
|
-
height=30
|
|
37
|
-
)
|
|
38
|
-
combobox.pack(pady=50)
|
|
39
|
-
|
|
40
|
-
values = [f"Item {i}" for i in range(1, 101)]
|
|
41
|
-
|
|
42
|
-
dropdown = CTkScrollableDropdown(
|
|
43
|
-
attach=combobox,
|
|
44
|
-
values=values,
|
|
45
|
-
command=lambda v: print("Selected:", v),
|
|
46
|
-
autocomplete=True,
|
|
47
|
-
groups=[
|
|
48
|
-
('1-50', r'^Item ([1-9]|[1-4][0-9]|50)$'),
|
|
49
|
-
('Others', '__OTHERS__')
|
|
50
|
-
],
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
app.mainloop()
|
|
54
|
-
```
|
{ctkscrollabledropdownpp-2.0.4 → ctkscrollabledropdownpp-2.1}/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
|