Guidance Forums / wxWidgets (wxWindows) in C++ / can't repain screen

Search 搜索
Home Home

Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. can't repain screen
Posted by: 2005-10-24 02:38:30

I have a problem repainting screen in OnPaint event. I have made a custom widget, overriding wxControl. So, whenever I press a key from keyboard I paint it on the screen with wxPaintDC, but whenever some text should be printed out independently from background process, it doesn't appear on the sceen. Even if I call OnPaint manually, the results are not shown before I move mouse or hit any key on keyboard. Calling Refresh and Update don't work also. So my question is, how can I flush that paint queue so that all my changes will be shown immediately?
Message2. Re: can't repain screen
Posted by: 2005-10-24 17:26:57
Uhh, I found the problem. I realized, that I was drawing onto screen from inside a thread, not the main application. Therefore I needed to call wxMutexGuiEnter() and wxMutexGuiLeave() to make things work the way I want.
Message3. Re: can't repain screen
Posted by: guidance 2005-10-25 08:54:20
Great thanks for your experiences sharing!
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
© Wed 2018-3-21  Guidance Laboratory Inc. Hits:0