direct.gui.DirectDialog
from direct.gui.DirectDialog import DirectDialog, OkCancelDialog, OkDialog, RetryCancelDialog, YesNoCancelDialog, YesNoDialog, cleanupDialog, findDialog
This module defines various dialog windows for the DirectGUI system.
See the DirectDialog page in the programming manual for a more in-depth explanation and an example of how to use this class.
Inheritance diagram
- class DirectDialog(parent=None, **kw)[source]
Bases:
DirectFrame
- AllDialogs = {}
- PanelIndex = 0
- __init__(self, parent=None, **kw)[source]
Creates a popup dialog to alert and/or interact with user. Some of the main keywords that can be used to customize the dialog:
- Parameters
text (str) – Text message/query displayed to user
geom – Geometry to be displayed in dialog
buttonTextList – List of text to show on each button
buttonGeomList – List of geometry to show on each button
buttonImageList – List of images to show on each button
buttonValueList – List of values sent to dialog command for each button. If value is [] then the ordinal rank of the button is used as its value.
buttonHotKeyList – List of hotkeys to bind to each button. Typing the hotkey is equivalent to pressing the corresponding button.
suppressKeys – Set to true if you wish to suppress keys (i.e. Dialog eats key event), false if you wish Dialog to pass along key event.
buttonSize – 4-tuple used to specify custom size for each button (to make bigger then geom/text for example)
pad – Space between border and interior graphics
topPad – Extra space added above text/geom/image
midPad – Extra space added between text/buttons
sidePad – Extra space added to either side of text/buttons
buttonPadSF – Scale factor used to expand/contract button horizontal spacing
command – Callback command used when a button is pressed. Value supplied to command depends on values in buttonValueList.
Note
The number of buttons on the dialog depends on the maximum length of any button[Text|Geom|Image|Value]List specified. Values of None are substituted for lists that are shorter than the max length
- class OkCancelDialog(parent=None, **kw)[source]
Bases:
DirectDialog
- class OkDialog(parent=None, **kw)[source]
Bases:
DirectDialog
- class RetryCancelDialog(parent=None, **kw)[source]
Bases:
DirectDialog
- class YesNoCancelDialog(parent=None, **kw)[source]
Bases:
DirectDialog
- class YesNoDialog(parent=None, **kw)[source]
Bases:
DirectDialog