Re: prima behavior - blacking out areas...

From: Andy Harrison <aharrison+prima_at_gmail.com>
Date: Sat, 9 Feb 2008 17:03:15 -0500
To: prima <prima_at_prima.eu.org>

On Feb 8, 2008 5:56 PM, Dmitry Karasik <dmitry_at_karasik.eu.org> wrote:
>
> This output says that all these controls are painted with
> black (0x00 or 0x80) background. I assume that your screen depth
> is 15 bits or more, if it's not so please tell me then.

Yes, I'm running dual head, 1280x1024, 24-bit depth.

> Are these controls indeed black?
>
> Well anyway, I'm at loss why the black color is propagated as
> Label background. The color (backColor, to be precise), although
> can be explicitly set, usually isn't.
>
> I would like to ask you to run scripts in examples directory, they are
> simple enough (f.ex. examples/label.pl) to see whether controls there
> also become black or not. If, as I suspect, yes, then I need
> two experiments: first, in the culprit program, replace
> "run Prima" with this:
>
> printf qq(%06x\n), $label-> backColor;
> $label-> begin_paint;
> printf qq(%06x\n), $label-> backColor;
>

I added those lines and some Dumper for good measure...

  printf qq(%06x\n), $w->backColor;

  use Data::Dumper;

  $Data::Dumper::Varname = 'backColor_before';
  print Dumper( $w->backColor );

  $w->begin_paint;
  printf qq(%06x\n), $w->backColor;

  $Data::Dumper::Varname = 'backColor_after';
  print Dumper( $w->backColor );

__END__

run Prima;

ultra40:/usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Prima/examples
# ./label-debug.pl
ffffffff800f0002
cccccc
ultra40:/usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Prima/examples
# ./label-debug.pl
ffffffff800f0002
$backColor_before1 = '-2146500606';
cccccc
$backColor_after1 = 13421772;

> where $label would be the black widget in question.
> If that prints 0 or 80 (black) in any of these two, then
> I need to know how it happens. One way to find that is to add
> debug print in Widget.c, before line 2101 in Widget_backColor():
>
> printf("%s=%x\n", var->name, color);
>
> and possibly even
>
> eval("Carp::confess(0);");
>
> so it could be seen who set backColor to black, or rather, where
> that black backColor was inherited from. Also, add the line
>
> printf("%s propagated backColor from the owner\n");
>
> before lines 1367 and 2404 in the same file, to check if the color was
> badly inherited.
>

I made those changes and recompiled. Here is the label script output now...

ultra40:/usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Prima/examples
# ./label-debug.pl
Prima=80000002
HintWidget=ffff80
HintWidget=ffff80
HintWidget=ffff80
Prima=80000002
MainWindow1=80000002
MainWindow1=80000002
Button1=80000002
Button1=80000002
Label1=800f0002
Label1=800f0002
Button2=80000002
Button2=80000002
Label2=800f0002
Label2=800f0002
ffffffff800f0002
$backColor_before1 = '-2146500606';
cccccc
$backColor_after1 = 13421772;

-- 
Andy Harrison
public key: 0x67518262
Received on Sat 09 Feb 2008 - 23:03:20 CET

This archive was generated by hypermail 2.2.0 : Sat 19 Mar 2011 - 18:35:06 CET