Added wxAutoNSAutoreleasePool where needed for controls sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29657 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/cocoa/string.h"
|
||||
#include "wx/cocoa/autorelease.h"
|
||||
|
||||
#import <AppKit/NSPopUpButton.h>
|
||||
#import <AppKit/NSMenu.h>
|
||||
@@ -56,6 +57,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID winid,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
if(!CreateControl(parent,winid,pos,size,style,validator,name))
|
||||
return false;
|
||||
|
||||
@@ -158,6 +160,7 @@ int wxChoice::GetCount() const
|
||||
|
||||
wxString wxChoice::GetString(int n) const
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
return wxStringWithNSString([(NSPopUpButton*)m_cocoaNSView itemTitleAtIndex:n]);
|
||||
}
|
||||
|
||||
@@ -232,6 +235,7 @@ wxClientData* wxChoice::DoGetItemClientObject(int n) const
|
||||
|
||||
void wxChoice::SetSelection(int n)
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
[(NSPopUpButton*)m_cocoaNSView selectItemAtIndex:n];
|
||||
}
|
||||
|
||||
|
@@ -15,6 +15,8 @@
|
||||
#include "wx/dcmemory.h"
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/cocoa/autorelease.h"
|
||||
|
||||
#import <AppKit/NSImage.h>
|
||||
#import <AppKit/NSAffineTransform.h>
|
||||
#import <AppKit/NSGraphicsContext.h>
|
||||
@@ -67,6 +69,7 @@ bool wxMemoryDC::CocoaUnlockFocus()
|
||||
// instead copy the data to an offscreen window, then copy it back
|
||||
void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
if(m_selectedBitmap.Ok())
|
||||
{
|
||||
CocoaTakeFocus();
|
||||
|
Reference in New Issue
Block a user