MoreCustomTkinterWidgets 5.2.0__tar.gz → 5.3.0__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.
- {morecustomtkinterwidgets-5.2.0/src/MoreCustomTkinterWidgets.egg-info → morecustomtkinterwidgets-5.3.0}/PKG-INFO +4 -5
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/README.md +3 -4
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/pyproject.toml +1 -1
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/AnimatedImage.py +18 -12
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/Selector.py +32 -22
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/__init__.py +2 -2
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0/src/MoreCustomTkinterWidgets.egg-info}/PKG-INFO +4 -5
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/LICENSE +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/setup.cfg +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/AskDialog.py +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/AskValue.py +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/BetterCTkImage.py +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/DateSelector.py +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/FileExplorer.py +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/Images/back_arrow_dark.png +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/Images/back_arrow_light.png +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/Images/error.png +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/Images/file_dark.png +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/Images/file_light.png +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/Images/folder_dark.png +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/Images/folder_light.png +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/Images/forward_arrow_dark.png +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/Images/forward_arrow_light.png +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/Images/info.png +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/Images/new_folder_dark.png +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/Images/new_folder_light.png +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/Images/warning.png +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/Message.py +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/Separator.py +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets/SmoothFrame.py +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets.egg-info/SOURCES.txt +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets.egg-info/dependency_links.txt +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets.egg-info/requires.txt +0 -0
- {morecustomtkinterwidgets-5.2.0 → morecustomtkinterwidgets-5.3.0}/src/MoreCustomTkinterWidgets.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: MoreCustomTkinterWidgets
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.3.0
|
|
4
4
|
Summary: A package containing more widgets for customtkinter
|
|
5
5
|
Author: Fastattack
|
|
6
6
|
License: MIT License
|
|
@@ -17,14 +17,13 @@ Requires-Dist: Pillow>=9.5.0
|
|
|
17
17
|
Dynamic: license-file
|
|
18
18
|
|
|
19
19
|
# MoreCustomTkinterWidgets
|
|
20
|
-
By Fastattack, 2024
|
|
20
|
+
By Fastattack, 2024-2025
|
|
21
21
|
|
|
22
22
|
[](https://pypi.org/project/MoreCustomTkinterWidgets)
|
|
23
23
|
[](https://github.com/fastattackv/MoreCustomTkinterWidgets)
|
|
24
24
|
[](https://github.com/fastattackv/MoreCustomTkinterWidgets)
|
|
25
25
|
[](https://pypi.org/project/MoreCustomTkinterWidgets)
|
|
26
26
|
[](https://pypi.org/project/MoreCustomTkinterWidgets)
|
|
27
|
-
[](https://github.com/fastattackv/MoreCustomTkinterWidgets/tree/main/Source%20Code)
|
|
28
27
|
|
|
29
28
|
> [!NOTE]
|
|
30
29
|
> The package is cross-platform, but the Message class will only be able to create sounds if the winsound module is installed (only available on windows)
|
|
@@ -39,8 +38,8 @@ To install the package, you should use pip. Install the package with the followi
|
|
|
39
38
|
|
|
40
39
|
## Widgets
|
|
41
40
|
|
|
42
|
-
[
|
|
43
|
-
[
|
|
41
|
+
[Examples](Examples.md)
|
|
42
|
+
[Patch Notes](Patch%20notes.md)
|
|
44
43
|
|
|
45
44
|
### SmoothFrame
|
|
46
45
|
This widget is a normal frame but with one upgrade: animations !
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
# MoreCustomTkinterWidgets
|
|
2
|
-
By Fastattack, 2024
|
|
2
|
+
By Fastattack, 2024-2025
|
|
3
3
|
|
|
4
4
|
[](https://pypi.org/project/MoreCustomTkinterWidgets)
|
|
5
5
|
[](https://github.com/fastattackv/MoreCustomTkinterWidgets)
|
|
6
6
|
[](https://github.com/fastattackv/MoreCustomTkinterWidgets)
|
|
7
7
|
[](https://pypi.org/project/MoreCustomTkinterWidgets)
|
|
8
8
|
[](https://pypi.org/project/MoreCustomTkinterWidgets)
|
|
9
|
-
[](https://github.com/fastattackv/MoreCustomTkinterWidgets/tree/main/Source%20Code)
|
|
10
9
|
|
|
11
10
|
> [!NOTE]
|
|
12
11
|
> The package is cross-platform, but the Message class will only be able to create sounds if the winsound module is installed (only available on windows)
|
|
@@ -21,8 +20,8 @@ To install the package, you should use pip. Install the package with the followi
|
|
|
21
20
|
|
|
22
21
|
## Widgets
|
|
23
22
|
|
|
24
|
-
[
|
|
25
|
-
[
|
|
23
|
+
[Examples](Examples.md)
|
|
24
|
+
[Patch Notes](Patch%20notes.md)
|
|
26
25
|
|
|
27
26
|
### SmoothFrame
|
|
28
27
|
This widget is a normal frame but with one upgrade: animations !
|
|
@@ -95,11 +95,14 @@ class AnimatedImage(ctk.CTkImage):
|
|
|
95
95
|
return self._currently_animating
|
|
96
96
|
|
|
97
97
|
def start_animation(self):
|
|
98
|
-
""" Starts the animation loop """
|
|
99
|
-
self.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
""" Starts the animation loop. HAS TO BE CALLED AFTER THE IMAGE IS USED """
|
|
99
|
+
if self._configure_callback_list:
|
|
100
|
+
self._currently_animating = True
|
|
101
|
+
time_between_2_frames = self._light_image.info["duration"] if self._light_image is not None else self._dark_image.info["duration"]
|
|
102
|
+
self._time_between_frames = int(time_between_2_frames * self._speed_multiplier)
|
|
103
|
+
self._next_frame()
|
|
104
|
+
else:
|
|
105
|
+
raise RuntimeError("Tried to start the animation before using the image in a widget")
|
|
103
106
|
|
|
104
107
|
def stop_animation(self):
|
|
105
108
|
""" Stops the animation loop """
|
|
@@ -112,18 +115,21 @@ class AnimatedImage(ctk.CTkImage):
|
|
|
112
115
|
raise RuntimeError("Tried to stop the animation but it was not already running")
|
|
113
116
|
|
|
114
117
|
def start_animation_for(self, ms: int, reset_after_complete=False):
|
|
115
|
-
"""Starts the animation and stops automatically after the given time
|
|
118
|
+
"""Starts the animation and stops automatically after the given time. HAS TO BE CALLED AFTER THE IMAGE IS USED
|
|
116
119
|
|
|
117
120
|
:param ms: time to run the animation for (in ms)
|
|
118
121
|
:param reset_after_complete: if set to True: resets to the first frame of the animation when the animation stops
|
|
119
122
|
"""
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
if self._configure_callback_list:
|
|
124
|
+
try:
|
|
125
|
+
self._configure_callback_list[0].__self__.after(ms, self.stop_animation)
|
|
126
|
+
except AttributeError:
|
|
127
|
+
pass
|
|
128
|
+
else:
|
|
129
|
+
self.start_animation()
|
|
130
|
+
self.reset_after_complete = reset_after_complete
|
|
124
131
|
else:
|
|
125
|
-
|
|
126
|
-
self.reset_after_complete = reset_after_complete
|
|
132
|
+
raise RuntimeError("Tried to start the animation before using the image in a widget")
|
|
127
133
|
|
|
128
134
|
def set_to_frame(self, frame_index: int):
|
|
129
135
|
"""Sets the animation to the given frame
|
|
@@ -1,36 +1,44 @@
|
|
|
1
1
|
import customtkinter as ctk
|
|
2
|
+
from customtkinter import ThemeManager
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
class Selector(ctk.CTkFrame):
|
|
5
|
-
def __init__(self, master,
|
|
6
|
+
def __init__(self, master, names_list: list[str], multiple_choices=True, *args, **kwargs):
|
|
6
7
|
"""Selector widgets to select options in a list of options. Includes a search bar to find different elements faster.
|
|
7
8
|
|
|
8
9
|
:param master: master window for the widget
|
|
9
|
-
:param
|
|
10
|
+
:param names_list: list of the possible options, they should all be different
|
|
10
11
|
:param multiple_choices: Optional: if set to False, the user will be allowed to select only one item (default=True)
|
|
11
12
|
:param args: args for the CTkFrame widget
|
|
12
13
|
:param kwargs: kwargs for the CTkFrame widget
|
|
13
14
|
"""
|
|
14
15
|
super().__init__(master, *args, **kwargs)
|
|
15
16
|
|
|
17
|
+
self.grid_rowconfigure(0, weight=0)
|
|
18
|
+
self.grid_rowconfigure(1, weight=1)
|
|
19
|
+
self.grid_columnconfigure(0, weight=1)
|
|
20
|
+
self.grid_columnconfigure(1, weight=0)
|
|
21
|
+
|
|
16
22
|
self.search_var = ctk.StringVar(self)
|
|
17
23
|
self.search_var.trace_add("write", self._search_modified)
|
|
18
24
|
self.search_bar = ctk.CTkEntry(self, textvariable=self.search_var)
|
|
25
|
+
self.empty_search_button = ctk.CTkButton(self, width=10, height=10, fg_color="transparent", border_color=ThemeManager.theme["CTkEntry"]["border_color"], border_width=2, text="X", command=self._empty_search)
|
|
19
26
|
color = kwargs.pop("fg_color") if "fg_color" in kwargs else "transparent"
|
|
20
27
|
self.checkboxes_frame = ctk.CTkScrollableFrame(self, fg_color=color, *args, **kwargs)
|
|
21
|
-
self.search_bar.
|
|
22
|
-
self.
|
|
28
|
+
self.search_bar.grid(row=0, column=0, padx=3, pady=3, sticky="nsew")
|
|
29
|
+
self.empty_search_button.grid(row=0, column=1, padx=3, pady=3, sticky="nsew")
|
|
30
|
+
self.checkboxes_frame.grid(row=1, column=0, columnspan=2, padx=3, pady=3, sticky="nsew")
|
|
23
31
|
|
|
24
32
|
self.checkboxes = []
|
|
25
33
|
self.selected_indexes = []
|
|
26
34
|
self.multiple_choices = multiple_choices
|
|
27
35
|
|
|
28
|
-
if len(set(
|
|
29
|
-
for index in range(len(
|
|
30
|
-
self.checkboxes.append(ctk.CTkCheckBox(self.checkboxes_frame, text=
|
|
36
|
+
if len(set(names_list)) == len(names_list): # not 2 times the same item
|
|
37
|
+
for index in range(len(names_list)):
|
|
38
|
+
self.checkboxes.append(ctk.CTkCheckBox(self.checkboxes_frame, text=names_list[index], command=lambda a=index: self._selection(a)))
|
|
31
39
|
self._search_modified()
|
|
32
40
|
else:
|
|
33
|
-
raise ValueError("There is two times or more the same item in the given
|
|
41
|
+
raise ValueError("There is two times or more the same item in the given names_list")
|
|
34
42
|
|
|
35
43
|
def _selection(self, index: int):
|
|
36
44
|
""" Internal method: selects / unselects the given index """
|
|
@@ -58,40 +66,42 @@ class Selector(ctk.CTkFrame):
|
|
|
58
66
|
row = 0
|
|
59
67
|
for x in range(len(self.checkboxes)):
|
|
60
68
|
if self.checkboxes[x].cget("text").startswith(value):
|
|
61
|
-
self.checkboxes[x].grid(row=row, column=0,
|
|
69
|
+
self.checkboxes[x].grid(row=row, column=0, pady=3, sticky="w")
|
|
62
70
|
row += 1
|
|
63
71
|
else:
|
|
64
72
|
self.checkboxes[x].grid_forget()
|
|
65
73
|
self._reset_scroll()
|
|
66
74
|
|
|
75
|
+
def _empty_search(self):
|
|
76
|
+
""" Internal method: empties the search bar """
|
|
77
|
+
self.search_var.set("")
|
|
78
|
+
|
|
67
79
|
def get_all_items(self) -> list:
|
|
68
80
|
""" Returns all the items in the selector """
|
|
69
81
|
return [checkbox.cget("text") for checkbox in self.checkboxes]
|
|
70
82
|
|
|
71
|
-
def
|
|
72
|
-
""
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
:param multiple_choices: if set to False, the user will be allowed to select only one item
|
|
76
|
-
"""
|
|
77
|
-
if items is not None:
|
|
78
|
-
if len(set(items)) == len(items): # not 2 times the same item
|
|
83
|
+
def configure(self, require_redraw=False, **kwargs):
|
|
84
|
+
if "names_list" in kwargs:
|
|
85
|
+
names_list = kwargs.pop("names_list")
|
|
86
|
+
if len(set(names_list)) == len(names_list): # not 2 times the same item
|
|
79
87
|
# destroy old widgets
|
|
80
88
|
for checkbox in self.checkboxes:
|
|
81
89
|
checkbox.destroy()
|
|
82
90
|
self.checkboxes.clear()
|
|
83
91
|
self.selected_indexes.clear()
|
|
84
|
-
|
|
85
92
|
# create new ones
|
|
86
|
-
for index in range(len(
|
|
87
|
-
self.checkboxes.append(ctk.CTkCheckBox(self.checkboxes_frame, text=
|
|
93
|
+
for index in range(len(names_list)):
|
|
94
|
+
self.checkboxes.append(ctk.CTkCheckBox(self.checkboxes_frame, text=names_list[index], command=lambda a=index: self._selection(a)))
|
|
88
95
|
self._search_modified()
|
|
89
96
|
else:
|
|
90
|
-
raise ValueError("There is two times or more the same item in the given
|
|
97
|
+
raise ValueError("There is two times or more the same item in the given names_list")
|
|
91
98
|
|
|
92
|
-
if multiple_choices
|
|
99
|
+
if "multiple_choices" in kwargs:
|
|
100
|
+
multiple_choices = kwargs.pop("multiple_choices")
|
|
93
101
|
self.multiple_choices = multiple_choices
|
|
94
102
|
|
|
103
|
+
super().configure(require_redraw=require_redraw, **kwargs)
|
|
104
|
+
|
|
95
105
|
def clear_selections(self):
|
|
96
106
|
""" Clears the selections """
|
|
97
107
|
for index in self.selected_indexes:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: MoreCustomTkinterWidgets
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.3.0
|
|
4
4
|
Summary: A package containing more widgets for customtkinter
|
|
5
5
|
Author: Fastattack
|
|
6
6
|
License: MIT License
|
|
@@ -17,14 +17,13 @@ Requires-Dist: Pillow>=9.5.0
|
|
|
17
17
|
Dynamic: license-file
|
|
18
18
|
|
|
19
19
|
# MoreCustomTkinterWidgets
|
|
20
|
-
By Fastattack, 2024
|
|
20
|
+
By Fastattack, 2024-2025
|
|
21
21
|
|
|
22
22
|
[](https://pypi.org/project/MoreCustomTkinterWidgets)
|
|
23
23
|
[](https://github.com/fastattackv/MoreCustomTkinterWidgets)
|
|
24
24
|
[](https://github.com/fastattackv/MoreCustomTkinterWidgets)
|
|
25
25
|
[](https://pypi.org/project/MoreCustomTkinterWidgets)
|
|
26
26
|
[](https://pypi.org/project/MoreCustomTkinterWidgets)
|
|
27
|
-
[](https://github.com/fastattackv/MoreCustomTkinterWidgets/tree/main/Source%20Code)
|
|
28
27
|
|
|
29
28
|
> [!NOTE]
|
|
30
29
|
> The package is cross-platform, but the Message class will only be able to create sounds if the winsound module is installed (only available on windows)
|
|
@@ -39,8 +38,8 @@ To install the package, you should use pip. Install the package with the followi
|
|
|
39
38
|
|
|
40
39
|
## Widgets
|
|
41
40
|
|
|
42
|
-
[
|
|
43
|
-
[
|
|
41
|
+
[Examples](Examples.md)
|
|
42
|
+
[Patch Notes](Patch%20notes.md)
|
|
44
43
|
|
|
45
44
|
### SmoothFrame
|
|
46
45
|
This widget is a normal frame but with one upgrade: animations !
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|