Window
Bases: Tk
A class that wraps the tkinter.Tk class in order to provide a
more convenient api with additional bells and whistles. For more
information on how to use the inherited Tk methods, see the
tcl/tk documentation
and the Python documentation.

Examples:
```python
app = Window(title="My Application", themename="superhero")
app.mainloop()
```
Source code in src/ttkbootstrap/window.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | |
style
property
Return a reference to the ttkbootstrap.style.Style object.
__init__(title='ttkbootstrap', themename='litera', iconphoto='', size=None, position=None, minsize=None, maxsize=None, resizable=None, hdpi=True, scaling=None, transient=None, overrideredirect=False, alpha=1.0, **kwargs)
Parameters:
title (str):
The title that appears on the application titlebar.
themename (str):
The name of the ttkbootstrap theme to apply to the
application.
iconphoto (str):
A path to the image used for the titlebar icon.
Internally this is passed to the `Tk.iconphoto` method
and the image will be the default icon for all windows.
A ttkbootstrap image is used by default. To disable
this default behavior, set the value to `None` and use
the `Tk.iconphoto` or `Tk.iconbitmap` methods directly.
size (tuple[int, int]):
The width and height of the application window.
Internally, this argument is passed to the
`Window.geometry` method.
position (tuple[int, int]):
The horizontal and vertical position of the window on
the screen relative to the top-left coordinate.
Internally this is passed to the `Window.geometry`
method.
minsize (tuple[int, int]):
Specifies the minimum permissible dimensions for the
window. Internally, this argument is passed to the
`Window.minsize` method.
maxsize (tuple[int, int]):
Specifies the maximum permissible dimensions for the
window. Internally, this argument is passed to the
`Window.maxsize` method.
resizable (tuple[bool, bool]):
Specifies whether the user may interactively resize the
toplevel window. Must pass in two arguments that specify
this flag for _horizontal_ and _vertical_ dimensions.
This can be adjusted after the window is created by using
the `Window.resizable` method.
hdpi (bool):
Enable high-dpi support for Windows OS. This option is
enabled by default.
scaling (float):
Sets the current scaling factor used by Tk to convert
between physical units (for example, points, inches, or
millimeters) and pixels. The number argument is a
floating point number that specifies the number of pixels
per point on window's display.
transient (Union[Tk, Widget]):
Instructs the window manager that this widget is
transient with regard to the widget master. Internally
this is passed to the `Window.transient` method.
overrideredirect (bool):
Instructs the window manager to ignore this widget if
True. Internally, this argument is passed to the
`Window.overrideredirect(1)` method.
alpha (float):
On Windows, specifies the alpha transparency level of the
toplevel. Where not supported, alpha remains at 1.0. Internally,
this is processed as `Toplevel.attributes('-alpha', alpha)`.
**kwargs:
Any other keyword arguments that are passed through to tkinter.Tk() constructor
List of available keywords available at: https://docs.python.org/3/library/tkinter.html#tkinter.Tk
Source code in src/ttkbootstrap/window.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | |
destroy()
Destroy the window and all its children.
Source code in src/ttkbootstrap/window.py
344 345 346 347 | |
place_window_center()
Position the toplevel in the center of the screen. Does not account for titlebar height.
Source code in src/ttkbootstrap/window.py
349 350 351 352 353 354 355 356 357 358 359 | |