diff --git a/Prima/MsgBox.pm b/Prima/MsgBox.pm index 1985e86b..2dee18ef 100644 --- a/Prima/MsgBox.pm +++ b/Prima/MsgBox.pm @@ -103,6 +103,7 @@ sub message_box onExecute => sub { Prima::Utils::beep( $options) if $options && !$nosound; }, + %{$extras->{dialog} // {}}, ); my @btns = insert_buttons( $dlg, $buttons, $extras); @@ -221,6 +222,7 @@ sub input_box scaleChildren => 1, visible => 0, text => $title, + %{$extras->{dialog} // {}}, ); insert_buttons( $dlg, $buttons, $extras); @@ -396,12 +398,36 @@ is too big to fit to the dialog window without scrolling. Actual only for the message box, not for the input box. +=item buttons HASH + +To modify a button, an integer key with the corresponding C constant +can be set with the hash reference under the C key. The hash is the +profile passed to the button as creation parameters. For example, to change +the text and behavior of a button, the following construct can be used: + + 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 C<::modalResult> property ( see L ) must be reset +to 0. + =item defButton INTEGER Selects the default button in the dialog, i.e. the button that reacts on the return key. Its value must be to an C constant of the desired button. If this option is not set, the leftmost button is selected as the default. +=item dialog HASH + +An optional hash override the dialog properties + =item font FONT The message boxes use C, but the C option @@ -419,26 +445,6 @@ Only for C. Contains the profile hash passed to the input line as creation parameters. -=item buttons HASH - -To modify a button, an integer key with the corresponding C constant -can be set with the hash reference under the C key. The hash is the -profile passed to the button as creation parameters. For example, to change -the text and behavior of a button, the following construct can be used: - - 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 C<::modalResult> property ( see L ) must be reset -to 0. - =item owner WINDOW If set, the dialog owner is set to WINDOW, otherwise to C<$::main_window>.