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

Examples:
```python
app = Toplevel(title="My Toplevel")
app.mainloop()
```
Source code in src/ttkbootstrap/window.py
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 | |
style
property
Return a reference to the ttkbootstrap.style.Style object.
__init__(title='ttkbootstrap', iconphoto='', size=None, position=None, minsize=None, maxsize=None, resizable=None, transient=None, overrideredirect=False, windowtype=None, topmost=False, toolwindow=False, alpha=1.0, **kwargs)
Parameters:
title (str):
The title that appears on the application titlebar.
iconphoto (str):
A path to the image used for the titlebar icon.
Internally this is passed to the `Tk.iconphoto` method.
By default the application icon is used.
size (tuple[int, int]):
The width and height of the application window.
Internally, this argument is passed to the
`Toplevel.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 `Toplevel.geometry`
method.
minsize (tuple[int, int]):
Specifies the minimum permissible dimensions for the
window. Internally, this argument is passed to the
`Toplevel.minsize` method.
maxsize (tuple[int, int]):
Specifies the maximum permissible dimensions for the
window. Internally, this argument is passed to the
`Toplevel.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 `Toplevel.resizable` method.
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 `Toplevel.transient` method.
overrideredirect (bool):
Instructs the window manager to ignore this widget if
True. Internally, this argument is processed as
`Toplevel.overrideredirect(1)`.
windowtype (str):
On X11, requests that the window should be interpreted by
the window manager as being of the specified type. Internally,
this is passed to the `Toplevel.attributes('-type', windowtype)`.
See the [-type option](https://tcl.tk/man/tcl8.6/TkCmd/wm.htm#M64)
for a list of available options.
topmost (bool):
Specifies whether this is a topmost window (displays above all
other windows). Internally, this processed by the window as
`Toplevel.attributes('-topmost', 1)`.
toolwindow (bool):
On Windows, specifies a toolwindow style. Internally, this is
processed as `Toplevel.attributes('-toolwindow', 1)`.
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 (Dict):
Other optional keyword arguments.
Source code in src/ttkbootstrap/window.py
381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 | |
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
544 545 546 547 548 549 550 551 552 553 554 | |