|
From: Erick J. B. <er...@e-...> - 2001-02-03 19:01:14
|
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 =3D new Win32::GUI::Window(
-name =3D> "MainWin",
-text =3D> "Style Option",
-size =3D> [200, 200],
-pos =3D> [70, 70],
);
$MainWin->AddLabel(
-text =3D> "Hello World!",
-size =3D> [$MainWin->Width, $MainWin->Height],
-pos =3D> [0, 0],
-background =3D> [0,51,102],
-foreground =3D> [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 =3D new Win32::GUI::Window(
-name =3D> "MainWin",
-text =3D> "Style Option",
-size =3D> [200, 200],
-pos =3D> [70, 70],
);
$MainWin->AddLabel(
-text =3D> "Hello World!",
-size =3D> [$MainWin->Width, $MainWin->Height],
-pos =3D> [0, 0],
-style =3D> ES_CENTER | WS_VISIBLE,
-background =3D> [0,51,102],
-foreground =3D> [255,255,255],
);
$MainWin->Show();
Win32::GUI::Dialog();
sub MainWin_Terminate {
$MainWin->Hide();
return -1;
}
#--------------EOF---------------#
erick
never stop questioning
www.jeb.ca
|
|
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/
|
|
From: Erick J. B. <er...@e-...> - 2001-02-03 20:21:28
|
Jeremy, I didn't know that there was an -align option, but that is not really what I was concerned with, it's the colors. Why can't you use the two color options (ie. -background and -foreground) ALL the time, with any control? erick never stop questioning www.jeb.ca ----- Original Message ----- From: Jeremy Blonde <sco...@ya...> To: <per...@li...> Sent: Saturday, February 03, 2001 8:45 PM Subject: Re: [perl-win32-gui-users] Style Option Bug? > 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... |
|
From: Aldo C. <da...@pe...> - 2001-02-05 14:07:27
|
Erick J. Bourgeois wrote: > Jeremy, > > I didn't know that there was an -align option, but that is > not really what I was concerned with, it's the colors. > Why can't you use the two color options (ie. -background > and -foreground) ALL the time, with any control? because there are either bugs in my code, OR the Win32 SDK does not support what you want to do. I can fix bugs, but I can't provide what the SDK does not provide :-) that said, I've fixed Win32::GUI for your case (I have removed a check that avoided coloring if the Label has the SS_SIMPLE style. don't know why it didn't worked, but now it seems to work. if you explicitly add the SS_SIMPLE style to the Label, however, you don't get the background color, but this should not be a problem :-). cheers, Aldo __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print; |