Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

half-disappearing text win32::gui

by primus (Scribe)
on Feb 08, 2003 at 22:34 UTC ( [id://233783]=perlquestion: print w/replies, xml ) Need Help??

primus has asked for the wisdom of the Perl Monks concerning the following question:


hail monks,

i have an odd problem with win32::gui, when i run my application for an extended period of time, the text seems to not fully refresh. For example: in the window a label says, "This is a Test", and then after the program runs for a while and automatically updates the labels, the field will read, "This is a Te" and that's it. Where it is still suppose to read "This is a Test".

i am not sure why this would occur. on my label, i update using the $label->Text("This is a Test") method and i also do $label->Update(); doing the update method made no difference, nor did using the InvalidateRect method. granted i may be using them incorrectly but i dont think so. note: i called the InvalidateRect on the $main_window.

well, i dont know if anyone else has experienced this, but i am hoping for some hints, if you all would like a code example i would be more than happy to provide one.

thanks in advance monks

Replies are listed 'Best First'.
Re: half-disappearing text win32::gui
by dada (Chaplain) on Feb 11, 2003 at 14:46 UTC
    hmmmm.... I suspect you didn't specify a size for the Label AND the original text was shorter than the one you're changing it to.

    when Win32::GUI creates a Label, it tries to fit the text specified in the -text parameter. but if you later change the text to something longer, the Label itself doesn't grow in dimension, so you may very well see only part of the text.

    try giving a (big enough) size to the Label and see if it works (BTW, some sample code would help a lot :-).

    cheers,
    Aldo

    King of Laziness, Wizard of Impatience, Lord of Hubris

Re: half-disappearing text win32::gui
by bbfu (Curate) on Feb 09, 2003 at 16:37 UTC

    Without you posting the exact code is causing the problem (possibly stripped down to just what causes the problem), it's very difficult to say but it sounds like you might be changing the text to a string that is a different length/size than the original text and the width of the label is not automatically expanding to accommodate the new size of the text.

    I thought the labels always expanded but it's possible that under certain circumstances they don't. If you could post some code that duplicates the problem, we can try to help further.

    bbfu
    Black flowers blossum
    Fearless on my breath

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://233783]
Approved by Paladin
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-24 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found