Re: [Pyobjc-dev] import QTKit -> NSRecursiveLock errors
Brought to you by:
ronaldoussoren
From: Dirk S. <dir...@ma...> - 2009-06-24 01:01:06
|
(@Orestis: I Forgot to hit 'Reply All', so sorry if you're getting this twice) Actualy, if you do this, you *will* be able to use it in Interface Builder. The only requirement is that the class is loaded/imported before the nib is initialized. So if you, for instance, use an instance of your QTMovieView subclass in a nib owned by a specific windowController or viewController, import the QTMovieView subclass' module in the header of the controller's source file (if the controller is imported lazily), or otherwise, import it in the designated initializer of the controller (if you don't import the controller lazily, which is the more likely approach). Your QTMovieView subclass should instantiate fine as long as it is imported some time before the nib loads. Make sure you try making a release build of your project after setting this up though, to verify that the .py file that contains your QTMovieView subclass is actually bundled in the app. (I'm not sure if the current Xcode support/templates in PyObjC still relies on module_graph to detect what needs to be bundled and what not when building an autonomous .app, but if it does, your module will not be included if it's only imported in some class' instance or class methods). Cheers, - Dirk On Jun 16, 2009, at 5:19 PM, Orestis Markou wrote: > That's because at the time of the import (when main.m is executed) > there's no connection to the window server yet. > > To get around this, you need to start importing in the > 'applicationDidFinishLaunching' stage. If you want to subclass > QTMovieView, put it in a different module, and import it in the > delegate method. That probably means you can't use it in Interface > Builder - you may be able to set it at runtime, but I can't help you > there. > -- > or...@or... > http://orestis.gr/ > > > > > On 16 Jun 2009, at 18:13, Daniel Ashbrook wrote: > >> Does anybody have an idea on how I can deal with this? I got around >> the issue back in April but now am wanting to subclass a QTMovieView. >> >> Thanks, >> >> dan >> >> On Apr 27, 2009, at 12:25p, Daniel Ashbrook wrote: >> >>> I think I remember there being some discussion of this a while back, >>> but couldn't find it. >>> >>> Try this: >>> 1) Make a new Python Cocoa app in Xcode >>> 2) In the application delegate, insert the line "import QTKit" >>> 3) Run it >>> >>> I get: >>> >>> _RegisterApplication(), FAILED TO establish the default connection >>> to the WindowServer, _CGSDefaultConnection() is NULL. >>> 2009-04-27 12:22:41.794 QTVideoTest2[79402:10b] *** - >>> [NSRecursiveLock unlock]: lock (<NSRecursiveLock: 0x1c57730> >>> '(null)') unlocked when not locked >>> 2009-04-27 12:22:41.796 QTVideoTest2[79402:10b] *** Break on >>> _NSLockError() to debug. >>> 2009-04-27 12:22:41.796 QTVideoTest2[79402:10b] *** - >>> [NSRecursiveLock unlock]: lock (<NSRecursiveLock: 0x1c57730> >>> '(null)') unlocked when not locked >>> 2009-04-27 12:22:41.797 QTVideoTest2[79402:10b] *** Break on >>> _NSLockError() to debug. >>> 2009-04-27 12:22:41.801 QTVideoTest2[79402:10b] *** - >>> [NSRecursiveLock unlock]: lock (<NSRecursiveLock: 0x1c57730> >>> '(null)') unlocked when not locked >>> 2009-04-27 12:22:41.801 QTVideoTest2[79402:10b] *** Break on >>> _NSLockError() to debug. >>> 2009-04-27 12:22:41.804 QTVideoTest2[79402:10b] >>> NSInternalInconsistencyException - Error (1002) creating CGSWindow >>> 2009-04-27 12:22:41.811 QTVideoTest2[79402:10b] *** - >>> [NSRecursiveLock unlock]: lock (<NSRecursiveLock: 0x1c57730> >>> '(null)') unlocked when not locked >>> 2009-04-27 12:22:41.812 QTVideoTest2[79402:10b] *** Break on >>> _NSLockError() to debug. >>> 2009-04-27 12:22:41.812 QTVideoTest2[79402:10b] *** - >>> [NSRecursiveLock unlock]: lock (<NSRecursiveLock: 0x1c57730> >>> '(null)') unlocked when not locked >>> 2009-04-27 12:22:41.812 QTVideoTest2[79402:10b] *** Break on >>> _NSLockError() to debug. >>> 2009-04-27 12:22:41.813 QTVideoTest2[79402:10b] *** - >>> [NSRecursiveLock unlock]: lock (<NSRecursiveLock: 0x1c57730> >>> '(null)') unlocked when not locked >>> 2009-04-27 12:22:41.813 QTVideoTest2[79402:10b] *** Break on >>> _NSLockError() to debug. >>> 2009-04-27 12:22:41.814 QTVideoTest2[79402:10b] *** - >>> [NSRecursiveLock unlock]: lock (<NSRecursiveLock: 0x1c57730> >>> '(null)') unlocked when not locked >>> 2009-04-27 12:22:41.815 QTVideoTest2[79402:10b] *** Break on >>> _NSLockError() to debug. >>> >>> This is particularly frustrating as, in my real project, I am trying >>> to make a subclass of QTKit.QTCaptureView; however, I can't, as >>> importing yields the above errors. >>> >>> >>> dan >> >> >> ------------------------------------------------------------------------------ >> Crystal Reports - New Free Runtime and 30 Day Trial >> Check out the new simplified licensing option that enables unlimited >> royalty-free distribution of the report engine for externally facing >> server and web deployment. >> http://p.sf.net/sfu/businessobjects >> _______________________________________________ >> Pyobjc-dev mailing list >> Pyo...@li... >> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensing option that enables unlimited > royalty-free distribution of the report engine for externally facing > server and web deployment. > http://p.sf.net/sfu/businessobjects > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |