Added wxWakeUpMainThread, wxMutexGuiEnter, wxMutexGuiLeave,

wxMutexGuiLocker and wxThread_IsMain to assist with dealing with GUI
access from non-GUI threads.

wxPyOnDemandOutputWindow is now thread safe if non-GUI threads use
print, sys.stdout.write, etc.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-03-26 22:17:24 +00:00
parent c1e820a40e
commit 6e18ca6cf4
8 changed files with 297 additions and 49 deletions

View File

@@ -162,6 +162,23 @@ class wxWindowDisabler(wxWindowDisablerPtr):
class wxMutexGuiLockerPtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self,misc2c=misc2c):
if self.thisown == 1 :
misc2c.delete_wxMutexGuiLocker(self)
def __repr__(self):
return "<C wxMutexGuiLocker instance at %s>" % (self.this,)
class wxMutexGuiLocker(wxMutexGuiLockerPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(misc2c.new_wxMutexGuiLocker,_args,_kwargs)
self.thisown = 1
class wxTipProviderPtr :
def __init__(self,this):
self.this = this
@@ -716,11 +733,19 @@ wxCaret_GetBlinkTime = misc2c.wxCaret_GetBlinkTime
wxCaret_SetBlinkTime = misc2c.wxCaret_SetBlinkTime
wxSafeYield = misc2c.wxSafeYield
wxPostEvent = misc2c.wxPostEvent
wxWakeUpIdle = misc2c.wxWakeUpIdle
wxSafeYield = misc2c.wxSafeYield
wxWakeUpMainThread = misc2c.wxWakeUpMainThread
wxMutexGuiEnter = misc2c.wxMutexGuiEnter
wxMutexGuiLeave = misc2c.wxMutexGuiLeave
wxThread_IsMain = misc2c.wxThread_IsMain
wxShowTip = misc2c.wxShowTip