On 2010-12-05 10:17:43, DJIBEL wrote:
Show quoted text> Dear,
>
> What is the way to configure a MsgBox and messagebox widgets ? I want
to
Show quoted text> change color of button and background text of popups.
>
> my $MsgBox = $frame->MsgBox(
> -title => 'MsgBox',
> -type => 'okcancel',
> -message => "Test MsgBox",
> );
> my $button = $MsgBox->Show;
>
> # or
>
> my $messageBox = $frame->messageBox(
> -icon => 'info',
> -title => 'Message',
> -type => 'OK',
> -message => "Test messageBox",
> );
Hello Djibril,
messageBox is implemented using system dialogs, where possible (e.g. on
Windows platform), and there's no support to change the appearance of
system dialogs.
Tk::MsgBox is implemented using normal Tk widgets, so theoretically it
would be possible to add additional configuration options. But I am
loath to do that, because this is a manual translation of the Tcl/Tk
counterpart and I want to change as little as possible to it.
However, it would be possible to change some configuration aspects using
Tk's option database capability. E.g.
$mw=tkinit;
$mw->optionAdd("*MsgBox*Button.background", "red");
$mb=$mw->MsgBox;
...
This is limited, however, for example it's not possible to have one
button in one color and the other in another.
If you really need total configuration control, then you need to go with
something else, e.g. Tk::DialogBox.
Regards,
Slaven