xpuz.base
¤
Page addon classes such as routing and fonts, as well as the base app instance.
Addons
¤
Convenience and utility methods for all page classes.
_confirm_route
¤
_confirm_route(
*,
action: Callable = None,
condition: bool = None,
confirmation: Dict[str, bool] = {"close": True}
) -> bool
Allow the user to confirm if they wish to route through a messagebox.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action |
Callable
|
A function to call if the user confirms to route. |
None
|
condition |
bool
|
Only perform the confirmation if |
None
|
confirmation |
Dict[str, bool]
|
Passed in |
{'close': True}
|
Returns:
| Type | Description |
|---|---|
bool
|
The status of the route confirmation; whether it was accepted or not. |
Source code in src/xpuz/base.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
_route
¤
Method for all page-related classes to simplify navigation.
All class instances that use _route must have their content packed
and contain 4 content generation methods, as seen in the source code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page_ref |
Literal
|
The new page's name, used to retrieve the corresponding
class from |
required |
base |
CTk
|
The main app instance. |
required |
title |
str
|
The new page's title. |
required |
**kwargs |
Dict[str, bool]
|
Confirmation dictionary routed to _confirm_route. |
{}
|
Returns:
| Type | Description |
|---|---|
bool
|
Status of the route; whether it was performed or not. |
Source code in src/xpuz/base.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
_set_fonts
¤
_set_fonts() -> None
Initialise this instance with all the required CTkFont objects.
Source code in src/xpuz/base.py
32 33 34 35 36 37 38 39 40 41 42 43 | |
Base
¤
Bases: CTk, Addons
The main app instance. Contains methods used by all pages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs |
Dict[str, Union[Tuple[Dict[str, str], List[str]], Locale, ConfigParser]]
|
|
{}
|
Source code in src/xpuz/base.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
_exit_handler
¤
Called when the event WM_DELETE_WINDOW occurs or when the the
program must be restarted, in which case the restart default
parameter is overridden.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
restart |
bool
|
Whether to perform a restart or not. |
False
|
webapp_on |
bool
|
Whether the |
False
|
Source code in src/xpuz/base.py
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | |
_increment_launches
¤
_increment_launches() -> None
Increment launches in the program config by 1.
Source code in src/xpuz/base.py
208 209 210 211 212 213 214 215 | |
_set_dim
¤
Set the dimensions of the program during runtime.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dim |
Tuple[int, int]
|
The dimensions. |
DIM
|
Source code in src/xpuz/base.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | |
_toggle_fullscreen
¤
_toggle_fullscreen() -> None
Enable or disabled fullscreen mode.
Source code in src/xpuz/base.py
199 200 201 202 203 204 205 206 | |