controls sample tests a bit more

combox doesn't send start-up event
  spinbutton looks correct now
  slider had vertic/horiz flags mixed up
  threads use gdk_enter_gui()
  dnd works a bit more often


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-04-29 15:00:11 +00:00
parent b9a535f540
commit 19da43267e
14 changed files with 95 additions and 33 deletions

View File

@@ -47,6 +47,10 @@
#include <sched.h>
#endif
#ifdef __WXGTK12__
#include "gtk/gtk.h"
#endif
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
@@ -81,8 +85,10 @@ static pthread_t gs_tidMain;
// the key for the pointer to the associated wxThread object
static pthread_key_t gs_keySelf;
#ifndef __WXGTK12__
// this mutex must be acquired before any call to a GUI function
static wxMutex *gs_mutexGui;
#endif
// ============================================================================
// implementation
@@ -765,12 +771,15 @@ bool wxThreadModule::OnInit()
return FALSE;
}
#ifndef __WXGTK12__
gs_mutexGui = new wxMutex();
//wxThreadGuiInit();
#endif
gs_tidMain = pthread_self();
#ifndef __WXGTK12__
gs_mutexGui->Lock();
#endif
return TRUE;
}
@@ -789,12 +798,12 @@ void wxThreadModule::OnExit()
gs_allThreads[n]->Delete();
}
#ifndef __WXGTK12__
// destroy GUI mutex
gs_mutexGui->Unlock();
//wxThreadGuiExit();
delete gs_mutexGui;
#endif
// and free TLD slot
(void)pthread_key_delete(gs_keySelf);
@@ -806,12 +815,20 @@ void wxThreadModule::OnExit()
void wxMutexGuiEnter()
{
#ifdef __WXGTK12__
gdk_threads_enter();
#else
gs_mutexGui->Lock();
#endif
}
void wxMutexGuiLeave()
{
#ifdef __WXGTK12__
gdk_threads_leave();
#else
gs_mutexGui->Unlock();
#endif
}
#endif