|
From: Jeremy B. <sco...@ya...> - 2001-02-03 19:45:40
|
Erick,
It looks like it's only the ES_CENTER style that is
not being handled/not being used properly.
I tried adding "-align => center" and not modifying
"-style", and it ends up with the same result.
Perhaps others can give a little more insight as to
why the style is not being applied correctly.
In any case, I believe it would be better to move away
from modifying "-style" directly and instead use
"-align => center", to align the label. Or at least
use "-addstyle" or "-pushstyle" instead of just
"-style".
Jeremy Blonde
sco...@ya...
--- "Erick J. Bourgeois" <er...@e-...> wrote:
> When I create a label and/or combobox, give them
> color attributes and then try and use the -style
> option, the colors are completely ignored. That is,
> if I just use the control without the -style option,
> then the colors work. For example, the following
> works great:
>
> use Win32::GUI;
>
> $MainWin = new Win32::GUI::Window(
> -name => "MainWin",
> -text => "Style Option",
> -size => [200, 200],
> -pos => [70, 70],
> );
> $MainWin->AddLabel(
> -text => "Hello World!",
> -size => [$MainWin->Width, $MainWin->Height],
> -pos => [0, 0],
> -background => [0,51,102],
> -foreground => [255,255,255],
> );
> $MainWin->Show();
> Win32::GUI::Dialog();
>
> sub MainWin_Terminate {
> $MainWin->Hide();
> return -1;
> }
> #--------------EOF---------------#
>
> However, this ignores the color option altogether:
>
> use Win32::GUI;
>
> $MainWin = new Win32::GUI::Window(
> -name => "MainWin",
> -text => "Style Option",
> -size => [200, 200],
> -pos => [70, 70],
> );
> $MainWin->AddLabel(
> -text => "Hello World!",
> -size => [$MainWin->Width, $MainWin->Height],
> -pos => [0, 0],
> -style => ES_CENTER | WS_VISIBLE,
> -background => [0,51,102],
> -foreground => [255,255,255],
> );
> $MainWin->Show();
> Win32::GUI::Dialog();
>
> sub MainWin_Terminate {
> $MainWin->Hide();
> return -1;
> }
> #--------------EOF---------------#
>
>
>
> erick
> never stop questioning
> www.jeb.ca
>
__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/
|