Dialog (hwx.gui)

A top-level window mostly used for short-term tasks and brief communications with the user.

  • DialogBase (hwx.gui)


Public Methods

classmethod get (cls)

accept (self, returnValue)

createContents (self)

exec (self)

positionUnder (self, relativeTo, checkWasMoved=True, xoffset=0)

reject (self)

resize (self, width, height)

show (self)

Property Details

property closeOnEscape

The behavior when the user presses the Esc key in a dialog.

Method Details

classmethod get(cls)

Get singleton when dialog is implemented as a subclass

Used by associated Button/SpriteActions.

accept(self, returnValue)

Close the dialog and returnValue from exec.


To be implemented in derived class.


Show as a model dialog, blocking code execution until it is closed.

This is typically used to get user input before continuing. Dialog code returns the input from exec by calling self.accept(value).


The accepted value or None if the dialog is closed in any other way.

positionUnder(self, relativeTo, checkWasMoved=True, xoffset=0)

Positions the dialog under or over the relataveTo widget.

param relativeTo

The widget to position relative to.

type relativeTo


param checkWasMoved

Determines whether to check if widget is moved or not.

type checkWasMoved


param xoffset

The offset value for the widget for x-axis.

type xoffset



Syntactic sugar to close the exec dialog without accepting a value. None is returned from exec.

resize(self, width, height)

Resize width/height of dialog.

This does not prevent the user from manually resizing like setting the width/height does.


Shows the dialog and continues with script execution.