Re: disappearing text in child window
- Posted by DanM Apr 23, 2009
- 972 views
Below is demo stub for minor problem I'm encountering. It has two windows, one is child of first, and child has text written to it on activate.
But some few seconds after activation, I regularly hear some hard disk activity, and the text disappears.
What's up with that?
I know I can make the text reappear "onPaint" the child window, but that still shows a momentary flicker of the window, which I don't like, and I'm wondering WHY does the text disappear in the first place, and what causes the window to flicker when I'm not doing anything programmatically?
Dan
When you call wPuts(), you're drawing the text on the Window at that time. The next time a Paint event comes along, it "repaints" the Window blank again. This is why you need to put your drawing code into the Paint event, so the content is always drawn back to the window. If you're looking to just place static text on a Window, you should use a label control (LText) control instead.
-Greg
P.S. When posting in the EUforum, you do not need to insert line breaks () manually unless you want to add more lines. Simply type your text and insert a blank line to separate paragraphs. The text will wrap automatically. If you Quote with Reply to my post, you'll see what I mean.
Thanks for responding Greg!
I'll look at using a label, not sure at this point if that will completely suffice.
But what really confuses me is that the text disappearing seems to be somewhat specific to *my* system, as it *doesn't* disappear for Derek running my demo code. Does my demo disappear for you? For me, it disappears, that is, there must be as you said, a Paint event asserted, at exactly the same moment that I hear a hard disk access, but with no *programmatic* event occurring to assert the Paint event.
And the reason I put \\ at the end of my lines in the original post is because the demo code did not wrap, so when I read my own post and probably any responses, the wrapping of both my text and any responses go out as far as the longest line of code, so I have to scroll sideways over to read every line of response, which is a hassle, so I make my post have "shorter" lines by forcing line breaks. I guess that doesn't help me to read responses, as they'll probably auto-use the longest line as a limit to wrap to, but at least I don't have to scroll sideways to read each line of my own post. This may also be an artifact of my browsers setting for font size. It doesn't hurt to force line breaks, right?
Dan