MessageDialog (hwx.gui)#

class MessageDialog(message, parent=None, name='', button1='', button2='', button3='', behavior='normal', **kwds)#

Bases: Widget

A popup message dialog.

Used to display messages to the user. It may contain upto three buttons.

Attribute Table#

Name

Type

icon

property

message

property

Method Table#

Name

Description

get (self, v)

Returns the message text.

set (self, v)

Sets the specified message.

show (self)

Shows the MessageDialog and pauses exection till one button is clicked.

Example

from hwx import gui

def buttonClickCommand(buttonId):
if buttonId == 0:
   gui.tellUser("Accept button clicked.")
else:
   gui.tellUser("Reject button clicked.")

msg = gui.MessageDialog(message="This is an example for  message dialog",
                        icon="info", button1="Accept", button2="Reject",
                        command=buttonClickCommand)
btn = gui.PushButton("Click Me!", command=lambda: msg.show())
show(btn)
set(v)#

Sets the specified message.

Parameters:

v (str) – Message text to be displayed.

get(v)#

Returns the message text.

show()#

Shows the MessageDialog and pauses exection till one button is clicked.

Returns:

The button clicked.

Return type:

int

property message#

The text message to be displayed inside the dialog.

property icon#

The type of icon to be displayed. Valid choices are:

  • “noicon”

  • “informationicon”

  • “information”

  • “info”

  • “warningicon”

  • “warning”

  • “warn”

  • “erroricon”

  • “error”

  • “criticalicon”

  • “critical”

  • “questionicon”

  • “question”

  • “?”

  • “checkicon”

  • “check”

  • “redquestionicon”

  • “redquestion”

  • “redcheckicon”

  • “redcheck”