DockWindow (hwx.gui)

A dockable window.

It can exist in a floating state or can be attached to the main application window.

Inherits:
  • DialogBase (hwx.gui)

Properties

Public Methods

classmethod get (cls)

addMaximizeRestoreButtons (self, maximizeText=’Maximize’, restoreText=’Restore Down’)

createContents (self)

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

resize (self, width, height)

Property Details

property docked

Docks/Undocks the window and returns if the window is docked.

Method Details

classmethod get(cls)

Get singleton when dialog is implemented as a subclass

Used by associated Button/SpriteActions.

addMaximizeRestoreButtons(self, maximizeText='Maximize', restoreText='Restore Down')

Adds a maximize and a restore tool button to the title bar and implements the expected behavior when these are clicked.

param maximizeText

The tooltip of maximize button.

type maximizeText

str

param restoreText

The tooltip of restore button.

type restoreText

str

createContents(self)

To be implemented in derived class.

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

Widget

param checkWasMoved

Determines whether to check if widget is moved or not.

type checkWasMoved

bool

param xoffset

The offset value for the widget for x-axis.

type xoffset

int

resize(self, width, height)

Resize width/height of dialog.

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