• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa Python broken in Leopard??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Cocoa Python broken in Leopard??
      • From: Bill Bumgarner <email@hidden>
References: 
 >Cocoa Python broken in Leopard?? (From: Uliano Guerrini <email@hidden>)
 >Re: Cocoa Python broken in Leopard?? (From: Bill Bumgarner <email@hidden>)
 >Re: Cocoa Python broken in Leopard?? (From: Uliano Guerrini <email@hidden>)
 >Re: Cocoa Python broken in Leopard?? (From: Bill Bumgarner <email@hidden>)
 >Re: Cocoa Python broken in Leopard?? (From: Uliano Guerrini <email@hidden>)
 >Re: Cocoa Python broken in Leopard?? (From: Bill Bumgarner <email@hidden>)

  • Prev by Date: Re: -[NSApplication requestUserAttention:] return value?
  • Next by Date: Re: -[NSApplication requestUserAttention:] return value?
  • Previous by thread: Re: Cocoa Python broken in Leopard??
  • Next by thread: Re: Cocoa Python broken in Leopard??
  • Index(es):
    • Date
    • Thread