Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / can't repain screen

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

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

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
#7342
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
#7349
Posted by: guidance 2005-10-25 08:54:20
Great thanks for your experiences sharing!
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2024-12-14  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0