Dialog
Bases: BaseWidget
A simple dialog base class.
Source code in src/ttkbootstrap/dialogs/base.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 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 77 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 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | |
result
property
Returns the result of the dialog.
__init__(parent=None, title='', alert=False)
Parameters:
parent (Widget):
Makes the window the logical parent of the message box.
The messagebox is displayed on top of its parent window.
title (str):
The string displayed as the title of the message box.
This option is ignored on Mac OS X, where platform
guidelines forbid the use of a title on this kind of
dialog.
alert (bool):
Ring the display's bell when the dialog is shown.
Source code in src/ttkbootstrap/dialogs/base.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
build()
Build the dialog from settings
Source code in src/ttkbootstrap/dialogs/base.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |
create_body(master)
Create the dialog body.
This method should be overridden and is called by the build
method. Set the self._initial_focus for the widget that
should receive the initial focus.
Parameters:
master (Widget):
The parent widget.
Source code in src/ttkbootstrap/dialogs/base.py
81 82 83 84 85 86 87 88 89 90 91 92 93 | |
create_buttonbox(master)
Create the dialog button box.
This method should be overridden and is called by the build
method. Set the self._initial_focus for the button that
should receive the intial focus.
Parameters:
master (Widget):
The parent widget.
Source code in src/ttkbootstrap/dialogs/base.py
95 96 97 98 99 100 101 102 103 104 105 106 107 | |
show(position=None, wait_for_result=True)
Show the popup dialog Parameters:
wait_for_result:
position: tuple[int, int]
The x and y coordinates used to position the dialog. If no parent
then the dialog will anchor to the center of the parent window.
Source code in src/ttkbootstrap/dialogs/base.py
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 77 78 79 | |