Re: [Pyobjc-dev] NSFileWrapper.icon() returning None?
Brought to you by:
ronaldoussoren
From: Etienne P. <et...@br...> - 2003-09-25 13:25:27
|
On Thu, 25 Sep 2003, Dinu Gherman wrote: > does anybody get a real NSImage instance instead of None for some > existing path on his filesystem? I seem to always get None... See > code below... (I can't use NSWorkspace.iconForFile_() because it > needs an application, window server, whatever...). Hi Dinu, If you add AppKit.NSApplicationLoad() before calling f = NSFileWrapper.alloc().initWithPath_(path) it will work. It sets up all the housekeeping stuff you need, and you would then also be able to call NSWorkspace.sharedWorkspace() to use the methods in there. This can be used for all Python scripts where you need window server connections and stuff like that. EP |