use Prima;
use Prima::Application;
use Prima::MsgBox;
my $text = Prima::MsgBox::input_box( 'Sample input box', 'Enter text:', '');
$text = '(none)' unless defined $text;
Prima::MsgBox::message( "You have entered: '$text'", mb::Ok);
PROFILE parameter is a hash, that contains customization parameters for the buttons and the input line. To access input line "inputLine" hash key is used. See ``Buttons and profiles'' for more information on BUTTONS and PROFILES.
Returns different results depending on the caller context. In array context, returns two values: the result of "Prima::Dialog::execute", which is either "mb::Cancel" or one of "mb::XXX" constants of the dialog buttons; and the text entered. The input text is not restored to its original value if the dialog was cancelled. In scalar context returns the text entered, if the dialog was ended with "mb::OK" or "mb::Yes" result, or "undef" otherwise.
mb::Error
mb::Warning
mb::Information
mb::Question
While there can be several constants of the first set, only one constant from the second set can be selected. Depending on the message type constant, one of the predefined icons is displayed and one of the system sounds is played; if no message type constant is selected, no icon is displayed and no sound is emitted. In case if no sound is desired, a special constant "mb::NoSound" can be used.
PROFILE parameter is a hash, that contains customization parameters for the buttons. See ``Buttons and profiles'' for the explanations.
Returns the result of "Prima::Dialog::execute", which is either "mb::Cancel" or one of "mb::XXX" constants of the specified dialog buttons.
mb::OK
mb::Cancel
mb::Yes
mb::No
mb::Abort
mb::Retry
mb::Ignore
mb::Help
To provide more flexibility, PROFILES hash parameter can be used. In this hash, predefined keys can be used to tell the dialog methods about certain customizations:
Contains a profile hash, passed to the input line as creation parameters.
Prima::MsgBox::message( 'Hello', mb::OkCancel,
buttons => {
mb::Ok, {
text => '~Hello',
onClick => sub { Prima::message('Hello indeed!'); }
}
}
);
If it is not desired that the dialog must be closed when the user presses a button, its "::modalResult" property ( see Prima::Buttons ) must be reset to 0.