Posts tagged with pyobjc
Key Value Coding or KVC is a very important part of Cocoa. Accessing these properties can be a kludge though - you have to use
setValue_forKey_(value, key) and
valueForKey_(key) which is quite verbose. Luckily, PyObjC has a nice shortcut: a single underscore.
As I mentioned some time ago, I'm now doing contracting. At my current project we need to get some more people on board. So if you're a Pythonista and want to work on exciting and challenging stuff for a couple of months (or more), read on!
I often exchange small snippets or links with my girlfriend, and it's been very annoying having to right click on iChat, select the correct account and start a chat. So I've automated it!
Here is a small PyObjC snippet that will allow you to send iChat messages from the command line, using the ScriptingBridge framework and a bit of elbow grease. The next step would be to make a wrapper for it so it can live a an icon on the Desktop, but I'll try that some other time.
I've been stumbled a bit just now, trying to populate an NSOutlineView from PyObjC.
Read on for my solution!
I'm planning to do a screencast for this, but knowing myself, I'll just put the code here in case I run off to a different direction tomorrow...
So, I present a very lightly annotated hello world app in PyObjC!
Download PyObjC tutorial (24 KB)
If you like Python and you like Mac OS X, you should really check out PyObjC.
It's a bridge that allows you to create first-class Cocoa applications using Python. It also has support from Interface Builder and XCode in Leopard and it's already bundled with Apple's Developer Tools!
Unfortunately, if you followed the above link, it doesn't seem there's a lot of stuff going on. The examples are outdated and there hasn't been any update since January.
This is a call to arms to help the project gain some better documentation, for the benefit of everyone involved.