Re: Cocoa Python broken in Leopard??
Re: Cocoa Python broken in Leopard??
- Subject: Re: Cocoa Python broken in Leopard??
- From: Uliano Guerrini <email@hidden>
- Date: Wed, 7 Nov 2007 18:04:07 +0100
Il giorno 07/nov/07, alle ore 17:48, Bill Bumgarner ha scritto:
Import Quartz *after* the application's main event loop has been
started, either in applicationDidFinishLaunching_() as I
demonstrated in my first message:
class FoobarAppDelegate(NSObject):
def applicationDidFinishLaunching_(self, sender):
import Quartz
this is useless as the scope of that import is limited to that
function in that file
Or import it as the first line of the drawRect_() method of your view.
I found a better (much efficient, I hope) workaround:
Quartz = None
class MyView(NSView):
def awakeFromNib(self):
global Quartz
Quartz = __import__('Quartz')
def drawRect_(self, rect):
context = NSGraphicsContext.currentContext().graphicsPort()
Quartz.whatever()
here the import happens to be called only once per class and Quartz is
global to the whole file. Still it is not elegant but I can live with it
cheers,
uliano
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden