Skip to content

Commit

Permalink
add customizations for label,input,icon
Browse files Browse the repository at this point in the history
  • Loading branch information
dk committed Jan 19, 2025
1 parent 042d8b4 commit 7b2996c
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions Prima/MsgBox.pm
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,15 @@ sub message_box
$self-> clear;
$self-> put_image(0, ($self->height - $icon->height)/2, $icon);
},
%{$extras->{icon} // {}},
);
$iconRight = $iconView-> right;
}

my $label = $dlg-> insert( 'Label' , text => $text );
my $label = $dlg-> insert( 'Label' ,
text => $text,
%{$extras->{label} // {}},
);
unless ( defined $extras->{wordWrap} ) {
# can the text fit in a quarter of the screen?
my @as = map { $_ / 2 } $::application->size;
Expand Down Expand Up @@ -232,14 +236,15 @@ sub input_box
size => [ 415, 16],
text => $text,
showAccelChar => 1,
%{$extras->{label} // {}},
);

my $input = $dlg-> insert( InputLine =>
size => [ 415, 21],
origin => [ 10, 56],
text => $string,
current => 1,
defined($extras-> {inputLine}) ? %{$extras-> {inputLine}} : (),
%{$extras->{input} // {}},
);

my @ret = ( $dlg-> execute, $input-> text);
Expand Down Expand Up @@ -317,7 +322,7 @@ in the dialog.
The PROFILE parameter is a hash, that contains customization parameters for the
buttons and the input line. To access the input line parameters the
C<inputLine> hash key is used. See L<Buttons and profiles> for more
C<input> hash key is used. See L<Buttons and profiles> for more
information on BUTTONS and PROFILES.
Returns different results depending on the call context. In the array
Expand Down Expand Up @@ -439,12 +444,22 @@ Selects the help TOPIC invoked in the help viewer window if the C<mb::Help>
button is pressed by the user. If this option is not set, L<Prima> is
displayed.
=item inputLine HASH
=item icon HASH
Only for C<message_box>.
Contains the profile hash passed to the image viewer as creation parameters
=item input HASH
Only for C<input_box>.
Contains the profile hash passed to the input line as creation parameters.
=item label HASH
Contains the profile hash passed to the label as creation parameters.
=item owner WINDOW
If set, the dialog owner is set to WINDOW, otherwise to C<$::main_window>.
Expand Down

0 comments on commit 7b2996c

Please sign in to comment.