routing SetTitle to SetLabel as MSW does, fixing potential zombie pointers after mouse down events which delete windows

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@55172 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2008-08-22 13:08:41 +00:00
parent 1bf1c271b3
commit 34785fc861
2 changed files with 12 additions and 0 deletions

View File

@@ -92,6 +92,7 @@ public:
virtual void SetTitle( const wxString& title);
virtual wxString GetTitle() const;
virtual void SetLabel( const wxString& title);
virtual void Raise();
virtual void Lower();

View File

@@ -597,8 +597,14 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
if ( currentMouseWindow->GetEventHandler()->ProcessEvent(wxevent) )
{
/*
// this code is dangerous in case the delete in the mouse down occured further up in the chain, trying alternative
if ((currentMouseWindowParent != NULL) &&
(currentMouseWindowParent->GetChildren().Find(currentMouseWindow) == NULL))
*/
// deleted in the meantime
if ( g_MacLastWindow == NULL )
currentMouseWindow = NULL;
result = noErr;
@@ -1373,6 +1379,11 @@ void wxTopLevelWindowMac::MacActivate( long timestamp , bool inIsActivating )
}
void wxTopLevelWindowMac::SetTitle(const wxString& title)
{
SetLabel( title ) ;
}
void wxTopLevelWindowMac::SetLabel(const wxString& title)
{
wxWindow::SetLabel( title ) ;
UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ;