Renat Araslanow wrote:
> Subject: Can't see label with user defined font
> Reason: '-escapement' tag in font definition"

this is a (rather unpleasant) feature :-)
the label is there, and the text is even rotated 90╟, but it
falls outside of the label area. the reference point for the
text is the upper left corner of the label, so when you rotate
it, the text is above the label area. the following ASCII art
should (hopefully) explain what's happening:

               T
               X
               E
               T
  +------+    +------+
  |TEXT  |    |      |
  +------+    +------+
  normal      rotated

I did some research and found that, in order to see at least
some of the text inside the label, you need this:

    $W->AddLabel(
        -name=>"ok",
        -left=>0,-top=>100,
        -width=>500,-height=>500,
        -align => 'center',  # center horizontally
        -addstyle => 0x200, # SS_CENTERIMAGE (center vertically)
        -font=>$font1,
        -text=>"ooooooo",
    );

the only drawback to this is that SS_CENTERIMAGE works only for
a single-line text. if you try it with more than one line, it
just doesn't wrap.

another pretty ugly workaround to fit the text in the label area
is to add some newline before the text (eg. -text =>
"\r\n\r\noooooo").

> when i write in C and use it - it working pretty good.

you should've been writing something else, because in C it works
exactly the same way as Win32::GUI.


cheers,
Aldo

__END__
$_=q,just perl,,s, , another ,,s,$, hacker,,print;



Reply via email to