scustomtkinter 0.2.1__py3-none-any.whl
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.
- scustomtkinter/__init__.py +81 -0
- scustomtkinter/assets/images/error.png +0 -0
- scustomtkinter/assets/images/info.png +0 -0
- scustomtkinter/assets/images/warning.png +0 -0
- scustomtkinter/assets/sCTkThemes.json +1963 -0
- scustomtkinter/license_morecustomtkinterwidgets.txt +22 -0
- scustomtkinter/sctk_button_primary.py +366 -0
- scustomtkinter/sctk_button_secondary.py +354 -0
- scustomtkinter/sctk_button_tertiary.py +375 -0
- scustomtkinter/sctk_checkbox.py +270 -0
- scustomtkinter/sctk_combobox.py +155 -0
- scustomtkinter/sctk_core.py +15 -0
- scustomtkinter/sctk_dial.py +1472 -0
- scustomtkinter/sctk_dialog.py +701 -0
- scustomtkinter/sctk_dialog_toplevel.py +268 -0
- scustomtkinter/sctk_entry_primary.py +400 -0
- scustomtkinter/sctk_entry_secondary.py +342 -0
- scustomtkinter/sctk_file_explorer.py +879 -0
- scustomtkinter/sctk_frame.py +210 -0
- scustomtkinter/sctk_frame_labeled_primary.py +667 -0
- scustomtkinter/sctk_frame_labeled_secondary.py +598 -0
- scustomtkinter/sctk_frequency_display.py +636 -0
- scustomtkinter/sctk_label_primary.py +283 -0
- scustomtkinter/sctk_label_secondary.py +275 -0
- scustomtkinter/sctk_label_tertiary.py +278 -0
- scustomtkinter/sctk_messagebox.py +275 -0
- scustomtkinter/sctk_notebook.py +1103 -0
- scustomtkinter/sctk_optionmenu_border_mixin.py +203 -0
- scustomtkinter/sctk_optionmenu_primary.py +378 -0
- scustomtkinter/sctk_optionmenu_secondary.py +346 -0
- scustomtkinter/sctk_path_chooser.py +516 -0
- scustomtkinter/sctk_progress_bar.py +274 -0
- scustomtkinter/sctk_radiobutton.py +360 -0
- scustomtkinter/sctk_scroll_mixin.py +546 -0
- scustomtkinter/sctk_scrollable_frame.py +795 -0
- scustomtkinter/sctk_scrollbar.py +313 -0
- scustomtkinter/sctk_segmentedbutton.py +424 -0
- scustomtkinter/sctk_selector.py +581 -0
- scustomtkinter/sctk_separator.py +308 -0
- scustomtkinter/sctk_slider.py +264 -0
- scustomtkinter/sctk_smeter.py +405 -0
- scustomtkinter/sctk_smeter_bar.py +557 -0
- scustomtkinter/sctk_spinbox.py +664 -0
- scustomtkinter/sctk_switch.py +463 -0
- scustomtkinter/sctk_tableview.py +869 -0
- scustomtkinter/sctk_tabview.py +409 -0
- scustomtkinter/sctk_textbox_primary.py +291 -0
- scustomtkinter/sctk_textbox_secondary.py +225 -0
- scustomtkinter/sctk_toplevel.py +153 -0
- scustomtkinter/themeable_widget.py +938 -0
- scustomtkinter-0.2.1.dist-info/METADATA +336 -0
- scustomtkinter-0.2.1.dist-info/RECORD +101 -0
- scustomtkinter-0.2.1.dist-info/WHEEL +5 -0
- scustomtkinter-0.2.1.dist-info/entry_points.txt +2 -0
- scustomtkinter-0.2.1.dist-info/licenses/LICENSE +21 -0
- scustomtkinter-0.2.1.dist-info/licenses/scustomtkinter/license_morecustomtkinterwidgets.txt +22 -0
- scustomtkinter-0.2.1.dist-info/top_level.txt +2 -0
- scustomtkinter_pygubu/__init__.py +1 -0
- scustomtkinter_pygubu/designer/__init__.py +0 -0
- scustomtkinter_pygubu/designer/plugin.py +1854 -0
- scustomtkinter_pygubu/designer/properties.py +247 -0
- scustomtkinter_pygubu/sCTkButtonPrimarybo.py +46 -0
- scustomtkinter_pygubu/sCTkButtonSecondarybo.py +45 -0
- scustomtkinter_pygubu/sCTkButtonTertiarybo.py +44 -0
- scustomtkinter_pygubu/sCTkCheckBoxbo.py +45 -0
- scustomtkinter_pygubu/sCTkComboBoxbo.py +45 -0
- scustomtkinter_pygubu/sCTkCorebo.py +120 -0
- scustomtkinter_pygubu/sCTkDialbo.py +371 -0
- scustomtkinter_pygubu/sCTkDialogbo.py +397 -0
- scustomtkinter_pygubu/sCTkEntryPrimarybo.py +100 -0
- scustomtkinter_pygubu/sCTkEntrySecondarybo.py +98 -0
- scustomtkinter_pygubu/sCTkFileExplorerbo.py +189 -0
- scustomtkinter_pygubu/sCTkFrameLabeledPrimarybo.py +69 -0
- scustomtkinter_pygubu/sCTkFrameLabeledSecondarybo.py +71 -0
- scustomtkinter_pygubu/sCTkFramebo.py +46 -0
- scustomtkinter_pygubu/sCTkFrequencyDisplaybo.py +175 -0
- scustomtkinter_pygubu/sCTkLabelPrimarybo.py +45 -0
- scustomtkinter_pygubu/sCTkLabelSecondarybo.py +44 -0
- scustomtkinter_pygubu/sCTkLabelTertiarybo.py +45 -0
- scustomtkinter_pygubu/sCTkNotebookbo.py +392 -0
- scustomtkinter_pygubu/sCTkOptionMenuPrimarybo.py +45 -0
- scustomtkinter_pygubu/sCTkOptionMenuSecondarybo.py +39 -0
- scustomtkinter_pygubu/sCTkPathChooserbo.py +204 -0
- scustomtkinter_pygubu/sCTkProgressBarbo.py +45 -0
- scustomtkinter_pygubu/sCTkRadioButtonbo.py +45 -0
- scustomtkinter_pygubu/sCTkSMeterBarbo.py +153 -0
- scustomtkinter_pygubu/sCTkSMeterbo.py +101 -0
- scustomtkinter_pygubu/sCTkScrollableFramebo.py +66 -0
- scustomtkinter_pygubu/sCTkScrollbarbo.py +48 -0
- scustomtkinter_pygubu/sCTkSegmentedButtonbo.py +47 -0
- scustomtkinter_pygubu/sCTkSelectorbo.py +167 -0
- scustomtkinter_pygubu/sCTkSeparatorbo.py +141 -0
- scustomtkinter_pygubu/sCTkSliderbo.py +45 -0
- scustomtkinter_pygubu/sCTkSpinboxbo.py +200 -0
- scustomtkinter_pygubu/sCTkSwitchbo.py +45 -0
- scustomtkinter_pygubu/sCTkTableviewbo.py +188 -0
- scustomtkinter_pygubu/sCTkTabviewbo.py +226 -0
- scustomtkinter_pygubu/sCTkTextboxPrimarybo.py +45 -0
- scustomtkinter_pygubu/sCTkTextboxSecondarybo.py +45 -0
- scustomtkinter_pygubu/sCTkToplevelbo.py +55 -0
- scustomtkinter_pygubu/sCTkWidgetSetForPygubuDesigner.py +141 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
from pygubu.api.v1 import copy_custom_property, register_custom_property
|
|
2
|
+
|
|
3
|
+
from pygubu.plugins.customtkinter import nsctk
|
|
4
|
+
from pygubu.api.v1 import copy_custom_property
|
|
5
|
+
from pygubu.plugins.customtkinter.windows import (
|
|
6
|
+
CTkBO,
|
|
7
|
+
CTkToplevelBO
|
|
8
|
+
)
|
|
9
|
+
from pygubu.plugins.customtkinter.widgets import (
|
|
10
|
+
CTkButtonBO,
|
|
11
|
+
CTkCheckBoxBO,
|
|
12
|
+
CTkComboBoxBO,
|
|
13
|
+
CTkEntryBO,
|
|
14
|
+
CTkFrameBO,
|
|
15
|
+
CTkLabelBO,
|
|
16
|
+
CTkOptionMenuBO,
|
|
17
|
+
CTkProgressBarBO,
|
|
18
|
+
CTkRadioButtonBO,
|
|
19
|
+
CTkSegmentedButtonBO,
|
|
20
|
+
CTkScrollbarBO,
|
|
21
|
+
CTkSliderBO,
|
|
22
|
+
CTkSwitchBO,
|
|
23
|
+
CTkTextboxBO,
|
|
24
|
+
)
|
|
25
|
+
from pygubu.plugins.customtkinter.tabview import CTkTabviewBO
|
|
26
|
+
from pygubu.plugins.customtkinter.scrollableframe import CTkScrollableFrameBO
|
|
27
|
+
|
|
28
|
+
# from scustomtkinter import sCTkDialRange, sCTkDialSelector, sCTkDialContinuous
|
|
29
|
+
#
|
|
30
|
+
# Imports for the sCTK Widgets
|
|
31
|
+
#
|
|
32
|
+
from scustomtkinter_pygubu.sCTkDialbo import (
|
|
33
|
+
sCTkDialContinuousBO, id_continuous as sCTkDialContinuous_builder_id,
|
|
34
|
+
sCTkDialRangeBO, id_range as sCTkDialRange_builder_id,
|
|
35
|
+
sCTkDialSelectorBO, id_selector as sCTkDialSelector_builder_id,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
from scustomtkinter_pygubu.sCTkCorebo import (sCTkBO, builder_id as sCTk_builder_id)
|
|
39
|
+
from scustomtkinter_pygubu.sCTkToplevelbo import (sCTkToplevelBO, builder_id as sCTkToplevel_builder_id)
|
|
40
|
+
|
|
41
|
+
from scustomtkinter_pygubu.sCTkButtonPrimarybo import (sCTkButtonPrimaryBO, builder_id as sCTkButtonPrimary_builder_id)
|
|
42
|
+
from scustomtkinter_pygubu.sCTkButtonSecondarybo import (sCTkButtonSecondaryBO, builder_id as sCTkButtonSecondary_builder_id)
|
|
43
|
+
from scustomtkinter_pygubu.sCTkButtonTertiarybo import (sCTkButtonTertiaryBO, builder_id as sCTkButtonTertiary_builder_id)
|
|
44
|
+
|
|
45
|
+
from scustomtkinter_pygubu.sCTkCheckBoxbo import (sCTkCheckBoxBO, builder_id as sCTkCheckBox_builder_id)
|
|
46
|
+
from scustomtkinter_pygubu.sCTkComboBoxbo import (sCTkComboBoxBO, builder_id as sCTkComboBox_builder_id)
|
|
47
|
+
|
|
48
|
+
# from scustomtkinter_pygubu.sCTkDialbo import (sCTkDialBO, builder_id as sCTkDial_builder_id)
|
|
49
|
+
# from scustomtkinter_pygubu.sCTkDialogCorebo import (sCTkDialogCoreBO, builder_id as sCTkDialogCore_builder_id)
|
|
50
|
+
|
|
51
|
+
from scustomtkinter_pygubu.sCTkEntryPrimarybo import (sCTkEntryPrimaryBO, builder_id as sCTkEntryPrimary_builder_id)
|
|
52
|
+
from scustomtkinter_pygubu.sCTkEntrySecondarybo import (sCTkEntrySecondaryBO, builder_id as sCTkEntrySecondary_builder_id)
|
|
53
|
+
|
|
54
|
+
from scustomtkinter_pygubu.sCTkFileExplorerbo import (sCTkFileExplorerBO, builder_id as sCTkFileExplorer_builder_id)
|
|
55
|
+
|
|
56
|
+
from scustomtkinter_pygubu.sCTkFramebo import (sCTkFrameBO, builder_id as sCTkFrame_builder_id)
|
|
57
|
+
from scustomtkinter_pygubu.sCTkFrameLabeledPrimarybo import (sCTkFrameLabeledPrimaryBO, builder_id as sCTkFrameLabeledPrimary_builder_id)
|
|
58
|
+
from scustomtkinter_pygubu.sCTkFrameLabeledSecondarybo import (sCTkFrameLabeledSecondaryBO, builder_id as sCTkFrameLabeledSecondary_builder_id)
|
|
59
|
+
|
|
60
|
+
from scustomtkinter_pygubu.sCTkLabelPrimarybo import (sCTkLabelPrimaryBO, builder_id as sCTkLabelPrimary_builder_id)
|
|
61
|
+
from scustomtkinter_pygubu.sCTkLabelSecondarybo import (sCTkLabelSecondaryBO, builder_id as sCTkLabelSecondary_builder_id)
|
|
62
|
+
from scustomtkinter_pygubu.sCTkLabelTertiarybo import (sCTkLabelTertiaryBO, builder_id as sCTkLabelTertiary_builder_id)
|
|
63
|
+
|
|
64
|
+
from scustomtkinter_pygubu.sCTkOptionMenuPrimarybo import (sCTkOptionMenuPrimaryBO, builder_id as sCTkOptionMenuPrimary_builder_id)
|
|
65
|
+
from scustomtkinter_pygubu.sCTkOptionMenuSecondarybo import (sCTkOptionMenuSecondaryBO, builder_id as sCTkOptionMenuSecondary_builder_id)
|
|
66
|
+
|
|
67
|
+
from scustomtkinter_pygubu.sCTkPathChooserbo import (sCTkPathChooserBO, builder_id as sCTkPathChooser_builder_id)
|
|
68
|
+
|
|
69
|
+
from scustomtkinter_pygubu.sCTkProgressBarbo import (sCTkProgressBarBO, builder_id as sCTkProgressBar_builder_id)
|
|
70
|
+
from scustomtkinter_pygubu.sCTkRadioButtonbo import (sCTkRadioButtonBO, builder_id as sCTkRadioButton_builder_id)
|
|
71
|
+
|
|
72
|
+
from scustomtkinter_pygubu.sCTkScrollbarbo import (sCTkScrollbarBO, builder_id as sCTkScrollbar_builder_id)
|
|
73
|
+
from scustomtkinter_pygubu.sCTkScrollableFramebo import (sCTkScrollableFrameBO, builder_id as sCTkScrollableFrame_builder_id)
|
|
74
|
+
|
|
75
|
+
from scustomtkinter_pygubu.sCTkSegmentedButtonbo import (sCTkSegmentedButtonBO, builder_id as sCTkSegmentedButton_builder_id)
|
|
76
|
+
|
|
77
|
+
from scustomtkinter_pygubu.sCTkSelectorbo import (sCTkSelectorBO, builder_id as sCTkSelector_builder_id)
|
|
78
|
+
|
|
79
|
+
# from scustomtkinter_pygubu.sCTkSeparatorbo import (sCTkSeparatorBO, builder_id as sCTkSeparator_builder_id)
|
|
80
|
+
|
|
81
|
+
from scustomtkinter_pygubu.sCTkSliderbo import (sCTkSliderBO, builder_id as sCTkSlider_builder_id)
|
|
82
|
+
|
|
83
|
+
# from scustomtkinter_pygubu.sCTkSMeterbo import (sCTkSMeterBO, builder_id as sCTkSMeter_builder_id)
|
|
84
|
+
# from scustomtkinter_pygubu.sCTkSMeterBarbo import (sCTkSMeterBarBO, builder_id as sCTkSMeterBar_builder_id)
|
|
85
|
+
|
|
86
|
+
from scustomtkinter_pygubu.sCTkSpinboxbo import (sCTkSpinboxBO, builder_id as sCTkSpinbox_builder_id)
|
|
87
|
+
|
|
88
|
+
from scustomtkinter_pygubu.sCTkSwitchbo import (sCTkSwitchBO, builder_id as sCTkSwitch_builder_id)
|
|
89
|
+
|
|
90
|
+
from scustomtkinter_pygubu.sCTkTabviewbo import (sCTkTabviewBO, builder_id as sCTkTabview_builder_id)
|
|
91
|
+
|
|
92
|
+
from scustomtkinter_pygubu.sCTkTableviewbo import (sCTkTableviewBO, builder_id as sCTkTableview_builder_id)
|
|
93
|
+
|
|
94
|
+
from scustomtkinter_pygubu.sCTkTextboxPrimarybo import (sCTkTextboxPrimaryBO, builder_id as sCTkTextboxPrimary_builder_id)
|
|
95
|
+
from scustomtkinter_pygubu.sCTkTextboxSecondarybo import (sCTkTextboxSecondaryBO, builder_id as sCTkTextboxSecondary_builder_id)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
# Copy properties before we define our own properties.
|
|
99
|
+
#
|
|
100
|
+
# nsctk is the customtkinter plugin namespace
|
|
101
|
+
# nsctk.CTkButton is the registered name for CTkButtonBO builder.
|
|
102
|
+
for pname in CTkButtonBO.properties:
|
|
103
|
+
try:
|
|
104
|
+
copy_custom_property(nsctk.CTkButton, pname, sCTkButtonPrimary_builder_id)
|
|
105
|
+
copy_custom_property(nsctk.CTkButton, pname, sCTkButtonSecondary_builder_id)
|
|
106
|
+
copy_custom_property(nsctk.CTkButton, pname, sCTkButtonTertiary_builder_id)
|
|
107
|
+
except RuntimeError:
|
|
108
|
+
pass # uconfigured property?
|
|
109
|
+
|
|
110
|
+
for pname in CTkCheckBoxBO.properties:
|
|
111
|
+
try:
|
|
112
|
+
copy_custom_property(nsctk.CTkCheckBox, pname, sCTkCheckBox_builder_id)
|
|
113
|
+
except RuntimeError:
|
|
114
|
+
pass
|
|
115
|
+
|
|
116
|
+
for pname in CTkComboBoxBO.properties:
|
|
117
|
+
copy_custom_property(nsctk.CTkComboBox, pname, sCTkComboBox_builder_id)
|
|
118
|
+
|
|
119
|
+
for pname in CTkEntryBO.properties:
|
|
120
|
+
try:
|
|
121
|
+
copy_custom_property(nsctk.CTkEntry, pname, sCTkEntryPrimary_builder_id)
|
|
122
|
+
copy_custom_property(nsctk.CTkEntry, pname, sCTkEntrySecondary_builder_id)
|
|
123
|
+
except RuntimeError:
|
|
124
|
+
pass
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
for pname in CTkLabelBO.properties:
|
|
128
|
+
try:
|
|
129
|
+
copy_custom_property(nsctk.CTkLabel, pname, sCTkLabelPrimary_builder_id)
|
|
130
|
+
copy_custom_property(nsctk.CTkLabel, pname, sCTkLabelSecondary_builder_id)
|
|
131
|
+
copy_custom_property(nsctk.CTkLabel, pname, sCTkLabelTertiary_builder_id)
|
|
132
|
+
except RuntimeError:
|
|
133
|
+
pass
|
|
134
|
+
|
|
135
|
+
for pname in CTkOptionMenuBO.properties:
|
|
136
|
+
copy_custom_property(nsctk.CTkOptionMenu, pname, sCTkOptionMenuPrimary_builder_id)
|
|
137
|
+
copy_custom_property(nsctk.CTkOptionMenu, pname, sCTkOptionMenuSecondary_builder_id)
|
|
138
|
+
|
|
139
|
+
for pname in CTkProgressBarBO.properties:
|
|
140
|
+
try:
|
|
141
|
+
copy_custom_property(nsctk.CTkProgressBar, pname, sCTkProgressBar_builder_id)
|
|
142
|
+
except RuntimeError:
|
|
143
|
+
pass
|
|
144
|
+
|
|
145
|
+
for pname in CTkRadioButtonBO.properties:
|
|
146
|
+
copy_custom_property(nsctk.CTkRadioButton, pname, sCTkRadioButton_builder_id)
|
|
147
|
+
|
|
148
|
+
for pname in CTkScrollbarBO.properties:
|
|
149
|
+
try:
|
|
150
|
+
copy_custom_property(nsctk.CTkScrollbar, pname, sCTkScrollbar_builder_id)
|
|
151
|
+
except RuntimeError:
|
|
152
|
+
pass
|
|
153
|
+
|
|
154
|
+
for pname in CTkSliderBO.properties:
|
|
155
|
+
copy_custom_property(nsctk.CTkSlider, pname, sCTkSlider_builder_id)
|
|
156
|
+
|
|
157
|
+
for pname in CTkSwitchBO.properties:
|
|
158
|
+
try:
|
|
159
|
+
copy_custom_property(nsctk.CTkSwitch, pname, sCTkSwitch_builder_id)
|
|
160
|
+
except RuntimeError:
|
|
161
|
+
pass
|
|
162
|
+
|
|
163
|
+
for pname in CTkTabviewBO.properties:
|
|
164
|
+
try:
|
|
165
|
+
copy_custom_property(nsctk.CTkTabview, pname, sCTkTabview_builder_id)
|
|
166
|
+
except RuntimeError:
|
|
167
|
+
pass
|
|
168
|
+
|
|
169
|
+
for pname in CTkTextboxBO.properties:
|
|
170
|
+
try:
|
|
171
|
+
copy_custom_property(nsctk.CTkTextbox, pname, sCTkTextboxPrimary_builder_id)
|
|
172
|
+
copy_custom_property(nsctk.CTkTextbox, pname, sCTkTextboxSecondary_builder_id)
|
|
173
|
+
except RuntimeError:
|
|
174
|
+
pass
|
|
175
|
+
|
|
176
|
+
for pname in CTkBO.properties:
|
|
177
|
+
try:
|
|
178
|
+
copy_custom_property(nsctk.CTk, pname, sCTk_builder_id)
|
|
179
|
+
except RuntimeError:
|
|
180
|
+
pass
|
|
181
|
+
register_custom_property(
|
|
182
|
+
sCTk_builder_id, "appearance_mode", "choice",
|
|
183
|
+
values=("System", "Light", "Dark"),
|
|
184
|
+
state="readonly",
|
|
185
|
+
help="System follows the OS setting. This is CustomTkinter's own default."
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
for pname in CTkToplevelBO.properties:
|
|
189
|
+
try:
|
|
190
|
+
copy_custom_property(nsctk.CTkToplevel, pname, sCTkToplevel_builder_id)
|
|
191
|
+
except RuntimeError:
|
|
192
|
+
pass
|
|
193
|
+
|
|
194
|
+
# FIX: this block previously referenced CTkScrollableFrame_builder_id -- a name
|
|
195
|
+
# that is defined NOWHERE in this file (note the missing leading "s"). Every
|
|
196
|
+
# iteration raised NameError, and the bare `except:` swallowed all of them, so
|
|
197
|
+
# no property definition was ever copied to sCTkScrollableFrame. The designer
|
|
198
|
+
# therefore knew the property NAMES, inherited from CTkScrollableFrameBO's own
|
|
199
|
+
# properties tuple, but had no registered definition for any of them -- no type,
|
|
200
|
+
# no permitted values, no default. The visible symptom was `orientation`
|
|
201
|
+
# displaying as "horizontal" in the inspector when the widget's real default is
|
|
202
|
+
# "vertical".
|
|
203
|
+
#
|
|
204
|
+
# The bare except is narrowed to RuntimeError, matching every other block here.
|
|
205
|
+
# A bare except would hide this class of typo again.
|
|
206
|
+
# Each copy gets its OWN try. Grouping several under one try means the first
|
|
207
|
+
# property that fails for one widget silently skips every widget listed after
|
|
208
|
+
# it in that same iteration -- so widgets near the end of the list receive
|
|
209
|
+
# fewer property definitions than those near the start, with no error. Same
|
|
210
|
+
# loop-scope bug found in sCTkSegmentedButtonbo.py, at a different granularity.
|
|
211
|
+
#
|
|
212
|
+
# Adding a widget is one line in the target tuple.
|
|
213
|
+
_scrollableframe_targets = (
|
|
214
|
+
sCTkScrollableFrame_builder_id,
|
|
215
|
+
sCTkFrameLabeledPrimary_builder_id,
|
|
216
|
+
sCTkFrameLabeledSecondary_builder_id,
|
|
217
|
+
sCTkTableview_builder_id,
|
|
218
|
+
)
|
|
219
|
+
for pname in CTkScrollableFrameBO.properties:
|
|
220
|
+
for target in _scrollableframe_targets:
|
|
221
|
+
try:
|
|
222
|
+
copy_custom_property(nsctk.CTkScrollableFrame, pname, target)
|
|
223
|
+
except RuntimeError:
|
|
224
|
+
pass # unconfigured property
|
|
225
|
+
|
|
226
|
+
_frame_targets = (
|
|
227
|
+
sCTkFrame_builder_id,
|
|
228
|
+
sCTkSelector_builder_id,
|
|
229
|
+
sCTkSpinbox_builder_id,
|
|
230
|
+
sCTkFileExplorer_builder_id,
|
|
231
|
+
sCTkPathChooser_builder_id,
|
|
232
|
+
sCTkDialContinuous_builder_id,
|
|
233
|
+
sCTkDialRange_builder_id,
|
|
234
|
+
sCTkDialSelector_builder_id,
|
|
235
|
+
)
|
|
236
|
+
for pname in CTkFrameBO.properties:
|
|
237
|
+
for target in _frame_targets:
|
|
238
|
+
try:
|
|
239
|
+
copy_custom_property(nsctk.CTkFrame, pname, target)
|
|
240
|
+
except RuntimeError:
|
|
241
|
+
pass # unconfigured property
|
|
242
|
+
|
|
243
|
+
for pname in CTkSegmentedButtonBO.properties:
|
|
244
|
+
try:
|
|
245
|
+
copy_custom_property(nsctk.CTkSegmentedButton, pname, sCTkSegmentedButton_builder_id)
|
|
246
|
+
except RuntimeError:
|
|
247
|
+
pass # unconfigured property
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/python3
|
|
2
|
+
"""
|
|
3
|
+
sCTkButtonPrimary
|
|
4
|
+
|
|
5
|
+
sublass of CTkButton
|
|
6
|
+
|
|
7
|
+
UI source file: sCTkButtonPrimary.ui
|
|
8
|
+
"""
|
|
9
|
+
import tkinter as tk
|
|
10
|
+
import tkinter.ttk as ttk
|
|
11
|
+
from customtkinter import CTkButton
|
|
12
|
+
from pygubu.api.v1 import (
|
|
13
|
+
BuilderObject,
|
|
14
|
+
register_widget,
|
|
15
|
+
)
|
|
16
|
+
from scustomtkinter.sctk_button_primary import sCTkButtonPrimary
|
|
17
|
+
|
|
18
|
+
from pygubu.plugins.customtkinter.widgets import CTkButtonBO
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
#
|
|
22
|
+
# Builder definition section
|
|
23
|
+
#
|
|
24
|
+
widget_namespace = "scustomtkinter.sctk_button_primary"
|
|
25
|
+
widget_classname = "sCTkButtonPrimary"
|
|
26
|
+
builder_namespace = "scustomtkinter"
|
|
27
|
+
section_name = "sCustomTkinter"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class sCTkButtonPrimaryBO(CTkButtonBO):
|
|
31
|
+
class_ = sCTkButtonPrimary
|
|
32
|
+
|
|
33
|
+
def code_imports(self):
|
|
34
|
+
# should return an iterable of (module, classname/function) to import
|
|
35
|
+
# or None
|
|
36
|
+
imports = [(widget_namespace, widget_classname)]
|
|
37
|
+
imports.extend(self.code_extra_imports())
|
|
38
|
+
return imports
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
builder_id = f"{builder_namespace}.{widget_classname}"
|
|
42
|
+
register_widget(
|
|
43
|
+
builder_id, sCTkButtonPrimaryBO, widget_classname, ("ttk", section_name)
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/python3
|
|
2
|
+
"""
|
|
3
|
+
buttonSecondary
|
|
4
|
+
|
|
5
|
+
secondary ctk button
|
|
6
|
+
|
|
7
|
+
UI source file: sCTkButtonSecondary.ui
|
|
8
|
+
"""
|
|
9
|
+
import tkinter as tk
|
|
10
|
+
import tkinter.ttk as ttk
|
|
11
|
+
from customtkinter import CTkButton
|
|
12
|
+
from pygubu.api.v1 import (
|
|
13
|
+
BuilderObject,
|
|
14
|
+
register_widget,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
from scustomtkinter.sctk_button_secondary import sCTkButtonSecondary
|
|
18
|
+
from pygubu.plugins.customtkinter.widgets import CTkButtonBO
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
#
|
|
22
|
+
# Builder definition section
|
|
23
|
+
#
|
|
24
|
+
widget_namespace = "scustomtkinter.sctk_button_secondary"
|
|
25
|
+
widget_classname = "sCTkButtonSecondary"
|
|
26
|
+
builder_namespace = "scustomtkinter"
|
|
27
|
+
section_name = "sCustomTkinter"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class sCTkButtonSecondaryBO(CTkButtonBO):
|
|
31
|
+
class_ = sCTkButtonSecondary
|
|
32
|
+
|
|
33
|
+
def code_imports(self):
|
|
34
|
+
# should return an iterable of (module, classname/function) to import
|
|
35
|
+
# or None
|
|
36
|
+
imports = [(widget_namespace, widget_classname)]
|
|
37
|
+
imports.extend(self.code_extra_imports())
|
|
38
|
+
return imports
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
builder_id = f"{builder_namespace}.{widget_classname}"
|
|
42
|
+
register_widget(
|
|
43
|
+
builder_id, sCTkButtonSecondaryBO, widget_classname, ("ttk", section_name)
|
|
44
|
+
)
|
|
45
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/python3
|
|
2
|
+
"""
|
|
3
|
+
sCTkButtonTertiary
|
|
4
|
+
|
|
5
|
+
ghost ctk button
|
|
6
|
+
|
|
7
|
+
UI source file: sCTkButtonTertiary.ui
|
|
8
|
+
"""
|
|
9
|
+
import tkinter as tk
|
|
10
|
+
import tkinter.ttk as ttk
|
|
11
|
+
from customtkinter import CTkButton
|
|
12
|
+
from pygubu.api.v1 import (
|
|
13
|
+
BuilderObject,
|
|
14
|
+
register_widget,
|
|
15
|
+
)
|
|
16
|
+
from scustomtkinter.sctk_button_tertiary import sCTkButtonTertiary
|
|
17
|
+
from pygubu.plugins.customtkinter.widgets import CTkButtonBO
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
#
|
|
21
|
+
# Builder definition section
|
|
22
|
+
#
|
|
23
|
+
widget_namespace = "scustomtkinter.sctk_button_tertiary"
|
|
24
|
+
widget_classname = "sCTkButtonTertiary"
|
|
25
|
+
builder_namespace = "scustomtkinter"
|
|
26
|
+
section_name = "sCustomTkinter"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class sCTkButtonTertiaryBO(CTkButtonBO):
|
|
30
|
+
class_ = sCTkButtonTertiary
|
|
31
|
+
|
|
32
|
+
def code_imports(self):
|
|
33
|
+
# should return an iterable of (module, classname/function) to import
|
|
34
|
+
# or None
|
|
35
|
+
imports = [(widget_namespace, widget_classname)]
|
|
36
|
+
imports.extend(self.code_extra_imports())
|
|
37
|
+
return imports
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
builder_id = f"{builder_namespace}.{widget_classname}"
|
|
41
|
+
register_widget(
|
|
42
|
+
builder_id, sCTkButtonTertiaryBO, widget_classname, ("ttk", section_name)
|
|
43
|
+
)
|
|
44
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/python3
|
|
2
|
+
"""
|
|
3
|
+
sCTkCheckBox
|
|
4
|
+
|
|
5
|
+
derived from CTkCheckBox
|
|
6
|
+
|
|
7
|
+
UI source file: sCTkCheckBox.ui
|
|
8
|
+
"""
|
|
9
|
+
import tkinter as tk
|
|
10
|
+
import tkinter.ttk as ttk
|
|
11
|
+
from customtkinter import CTkCheckBox
|
|
12
|
+
from pygubu.api.v1 import (
|
|
13
|
+
BuilderObject,
|
|
14
|
+
register_widget,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
from pygubu.plugins.customtkinter.widgets import CTkCheckBoxBO
|
|
18
|
+
|
|
19
|
+
from scustomtkinter.sctk_checkbox import sCTkCheckBox
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
#
|
|
23
|
+
# Builder definition section
|
|
24
|
+
#
|
|
25
|
+
widget_namespace = "scustomtkinter.sctk_checkbox"
|
|
26
|
+
widget_classname = "sCTkCheckBox"
|
|
27
|
+
builder_namespace = "scustomtkinter"
|
|
28
|
+
section_name = "sCustomTkinter"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class sCTkCheckBoxBO(CTkCheckBoxBO):
|
|
32
|
+
class_ = sCTkCheckBox
|
|
33
|
+
def code_imports(self):
|
|
34
|
+
# should return an iterable of (module, classname/function) to import
|
|
35
|
+
# or None
|
|
36
|
+
imports = [(widget_namespace, widget_classname)]
|
|
37
|
+
imports.extend(self.code_extra_imports())
|
|
38
|
+
return imports
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
builder_id = f"{builder_namespace}.{widget_classname}"
|
|
42
|
+
register_widget(
|
|
43
|
+
builder_id, sCTkCheckBoxBO, widget_classname, ("ttk", section_name)
|
|
44
|
+
)
|
|
45
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/python3
|
|
2
|
+
"""
|
|
3
|
+
sCTkComboBox
|
|
4
|
+
|
|
5
|
+
derived from comboBox
|
|
6
|
+
|
|
7
|
+
UI source file: sCTkComboBox.ui
|
|
8
|
+
"""
|
|
9
|
+
import tkinter as tk
|
|
10
|
+
import tkinter.ttk as ttk
|
|
11
|
+
from customtkinter import CTkComboBox
|
|
12
|
+
from pygubu.api.v1 import (
|
|
13
|
+
BuilderObject,
|
|
14
|
+
register_widget,
|
|
15
|
+
)
|
|
16
|
+
from pygubu.plugins.customtkinter.widgets import CTkComboBoxBO
|
|
17
|
+
|
|
18
|
+
from scustomtkinter.sctk_combobox import sCTkComboBox
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
#
|
|
22
|
+
# Builder definition section
|
|
23
|
+
#
|
|
24
|
+
widget_namespace = "scustomtkinter.sctk_combobox"
|
|
25
|
+
widget_classname = "sCTkComboBox"
|
|
26
|
+
builder_namespace = "scustomtkinter"
|
|
27
|
+
section_name = "sCustomTkinter"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class sCTkComboBoxBO(CTkComboBoxBO):
|
|
31
|
+
class_ = sCTkComboBox
|
|
32
|
+
|
|
33
|
+
def code_imports(self):
|
|
34
|
+
# should return an iterable of (module, classname/function) to import
|
|
35
|
+
# or None
|
|
36
|
+
imports = [(widget_namespace, widget_classname)]
|
|
37
|
+
imports.extend(self.code_extra_imports())
|
|
38
|
+
return imports
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
builder_id = f"{builder_namespace}.{widget_classname}"
|
|
42
|
+
register_widget(
|
|
43
|
+
builder_id, sCTkComboBoxBO, widget_classname, ("ttk", section_name)
|
|
44
|
+
)
|
|
45
|
+
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/python3
|
|
2
|
+
|
|
3
|
+
import tkinter as tk
|
|
4
|
+
import tkinter.ttk as ttk
|
|
5
|
+
|
|
6
|
+
from pygubu.api.v1 import (
|
|
7
|
+
BuilderObject,
|
|
8
|
+
register_widget,
|
|
9
|
+
register_custom_property
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
from pygubu.plugins.customtkinter import nsctk
|
|
13
|
+
from pygubu.plugins.customtkinter.windows import CTkBO
|
|
14
|
+
from pygubu.api.v1 import copy_custom_property
|
|
15
|
+
|
|
16
|
+
from scustomtkinter.sctk_core import sCTk
|
|
17
|
+
from pygubu.plugins.customtkinter._config import GROOT
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
#
|
|
21
|
+
# Builder definition section
|
|
22
|
+
#
|
|
23
|
+
widget_namespace = "scustomtkinter.sctk_core"
|
|
24
|
+
widget_classname = "sCTk"
|
|
25
|
+
builder_namespace = "scustomtkinter"
|
|
26
|
+
section_name = "sCustomTkinter"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class sCTkBO(CTkBO):
|
|
30
|
+
class_ = sCTk
|
|
31
|
+
container = True
|
|
32
|
+
|
|
33
|
+
def code_imports(self):
|
|
34
|
+
"""
|
|
35
|
+
Imports needed by generated code for this widget.
|
|
36
|
+
|
|
37
|
+
FIX: this previously returned only the sCTk import, dropping the
|
|
38
|
+
conditional part of CTkBO.code_imports(). CTkBO adds
|
|
39
|
+
set_appearance_mode and set_default_color_theme when those properties
|
|
40
|
+
are set, because _code_set_property() generates bare calls to them:
|
|
41
|
+
|
|
42
|
+
set_appearance_mode("dark")
|
|
43
|
+
|
|
44
|
+
Without the matching import, setting appearance_mode or color_theme in
|
|
45
|
+
the Designer produced a generated file that raised NameError the
|
|
46
|
+
moment it ran. Those two functions come from customtkinter itself, not
|
|
47
|
+
from this library, so they are imported from there.
|
|
48
|
+
"""
|
|
49
|
+
imports = [(widget_namespace, widget_classname)]
|
|
50
|
+
if "appearance_mode" in self.wmeta.properties:
|
|
51
|
+
imports.append(("customtkinter", "set_appearance_mode"))
|
|
52
|
+
if "color_theme" in self.wmeta.properties:
|
|
53
|
+
imports.append(("customtkinter", "set_default_color_theme"))
|
|
54
|
+
return imports
|
|
55
|
+
|
|
56
|
+
def _set_property(self, target_widget, pname, value):
|
|
57
|
+
"""
|
|
58
|
+
Applies a property, guarding the two global CustomTkinter settings
|
|
59
|
+
against an empty value.
|
|
60
|
+
|
|
61
|
+
Blanking a property in the Designer inspector makes pygubu call
|
|
62
|
+
unset_property(), which resolves the property's default and passes it
|
|
63
|
+
through. These two have no widget-level default to read back, so that
|
|
64
|
+
value is None -- and CTkBO's own version hands it straight to
|
|
65
|
+
ctk.set_appearance_mode(), which does mode_string.lower() and raises
|
|
66
|
+
AttributeError on NoneType.
|
|
67
|
+
|
|
68
|
+
The two are guarded DIFFERENTLY, on purpose.
|
|
69
|
+
|
|
70
|
+
appearance_mode falls back to "System", which is a real state and
|
|
71
|
+
CustomTkinter's own default: follow the OS. A user who tries Dark,
|
|
72
|
+
then Light, then wants the system to decide again needs a route back.
|
|
73
|
+
Ignoring the call would strand them on the last explicit mode, which
|
|
74
|
+
is exactly what they are trying to escape. This package also registers
|
|
75
|
+
"System" as an explicit choice, so it is reachable without clearing
|
|
76
|
+
the field -- CustomTkinter's own property offers only blank, Light
|
|
77
|
+
and Dark.
|
|
78
|
+
|
|
79
|
+
color_theme has no equivalent unset state: CustomTkinter always needs
|
|
80
|
+
some theme loaded, and reverting to "blue" would be a guess rather
|
|
81
|
+
than a reversion. Blank is ignored, leaving the current theme alone.
|
|
82
|
+
"""
|
|
83
|
+
if pname == "appearance_mode":
|
|
84
|
+
return super()._set_property(target_widget, pname, value or "System")
|
|
85
|
+
if pname == "color_theme" and not value:
|
|
86
|
+
return None
|
|
87
|
+
return super()._set_property(target_widget, pname, value)
|
|
88
|
+
|
|
89
|
+
def _code_set_property(self, targetid, pname, value, code_bag):
|
|
90
|
+
"""
|
|
91
|
+
Same guard, for generated code.
|
|
92
|
+
|
|
93
|
+
CTkBO interpolates the value into a string literal:
|
|
94
|
+
|
|
95
|
+
set_appearance_mode("{value}")
|
|
96
|
+
|
|
97
|
+
so a blank one emits set_appearance_mode("None") or
|
|
98
|
+
set_appearance_mode("") -- valid Python that raises in the user's
|
|
99
|
+
application rather than in the Designer, which makes it harder to
|
|
100
|
+
trace back here.
|
|
101
|
+
"""
|
|
102
|
+
if pname == "appearance_mode":
|
|
103
|
+
value = value or "System"
|
|
104
|
+
elif pname == "color_theme" and not value:
|
|
105
|
+
return None
|
|
106
|
+
return super()._code_set_property(targetid, pname, value, code_bag)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
builder_id = f"{builder_namespace}.{widget_classname}"
|
|
110
|
+
|
|
111
|
+
register_widget(
|
|
112
|
+
builder_id, sCTkBO, widget_classname, ("ttk", section_name), group=GROOT
|
|
113
|
+
)
|
|
114
|
+
# register_custom_property(
|
|
115
|
+
# builder_id, "appearance_mode", "choice",
|
|
116
|
+
# values=("System", "Light", "Dark"),
|
|
117
|
+
# state="readonly",
|
|
118
|
+
# help="System follows the OS setting. This is CustomTkinter's own default."
|
|
119
|
+
# )
|
|
120
|
+
|