diff --git a/include/wx/osx/app.h b/include/wx/osx/app.h index 02710e57b1..d075cb8431 100644 --- a/include/wx/osx/app.h +++ b/include/wx/osx/app.h @@ -50,6 +50,10 @@ class WXDLLIMPEXP_CORE wxApp: public wxAppBase virtual bool OnInitGui(); #endif // wxUSE_GUI +#ifdef __WXOSX_IPHONE__ + virtual int OnRun(); +#endif + virtual bool ProcessIdle(); // implementation only diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index 6acca9a02d..8b8345022c 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -841,11 +841,13 @@ bool wxApp::Initialize(int& argc, wxChar **argv) return true; } +#if wxOSX_USE_COCOA_OR_CARBON bool wxApp::CallOnInit() { wxMacAutoreleasePool autoreleasepool; return OnInit(); } +#endif bool wxApp::OnInitGui() { diff --git a/src/osx/carbon/utilscocoa.mm b/src/osx/carbon/utilscocoa.mm index 25ec0b1e7e..1c2ec0dc70 100644 --- a/src/osx/carbon/utilscocoa.mm +++ b/src/osx/carbon/utilscocoa.mm @@ -249,7 +249,7 @@ WX_UIFont wxFont::OSXCreateUIFont(wxOSXSystemFont font, wxNativeFontInfo* info) if ( traits & NSFontItalicTrait ) fontstyle = wxFONTSTYLE_ITALIC ; */ - wxCFStringRef fontname( [uifont familyName] ); + wxCFStringRef fontname( wxCFRetain([uifont familyName]) ); info->Init(size,wxFONTFAMILY_DEFAULT,fontstyle,fontweight,underlined, fontname.AsString(), wxFONTENCODING_DEFAULT); @@ -270,6 +270,17 @@ WX_UIFont wxFont::OSXCreateUIFont(const wxNativeFontInfo* info) // NSImage Utils // ---------------------------------------------------------------------------- +#if wxOSX_USE_IPHONE + +WX_UIImage wxOSXCreateUIImageFromCGImage( CGImageRef image ) +{ + UIImage *newImage = [UIImage imageWithCGImage:image]; + [newImage autorelease]; + return( newImage ); +} + +#endif + #if wxOSX_USE_COCOA // From "Cocoa Drawing Guide:Working with Images"