14 Feb 2021 12:53:44 UTC
- Distribution: Tk
- Source (raw)
- Browse (raw)
- How to Contribute
- Clone repository
- Issues (141)
- Testers (1028 / 10 / 0)
- KwaliteeBus factor: 1
- % Coverage
- License: unrestricted
- Activity24 month
- Download (6.7MB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:14 non-PAUSE usersSREZIC Slaven Rezićand 1 contributors
- firstname.lastname@example.org (Nick Ing-Simmons)
Tk::messageBox - pop up a message window and wait for user response.
$response = $widget->messageBox(-option => value, ... );
This method uses Tk::Dialog to quickly create several common dialog boxes. A dialog widget consists of a message, an icon and a set of buttons (see the -type option). After the message window is popped up, messageBox waits for the user to select one of the buttons and return the button text (note that it's best to check the returned value in a case insensitive manner). NOTE: unlike Tk::Dialog which creates its widget once and can be used many times, the messageBox window is created every time it's used.
The following option/value pairs are supported:
The case-sensitive symbolic name of the default button for this message window ('Ok', 'Cancel' and so on). See -type for a list of the symbolic names. If the message box has just one button it will automatically be made the default, otherwise if this option is not specified, there won't be any default button.
Specifies an icon to display. On X11 any of the builtin Tk bitmaps can specified. On Windows only error, info, question or warning are supported.
Specifies the message to display.
Specifies a string to display as the title.
Specifies a predefined set of buttons to be displayed. The following values are possible: 'AbortRetryIgnore', 'Ok', 'OkCancel', 'RetryCancel', 'YesNo' or 'YesNoCancel'.
$response = $mw->messageBox(-icon => 'question', -message => 'Hello World!', -title => 'My title', -type => 'AbortRetryIgnore', -default => 'Retry');