Found 7 entries, viewing 6 through 7.
Building Cocoa GUIs in Python with PyObjC, Part Two
Starting A Cocoa-Python Application
Getting started is easy. First, install the Developer Tools if you haven't yet. Now launch Xcode and start a new project. Select "Cocoa-Python Application". You'll be presented with the following window.
Before we begin, go ahead and double-click on "MainMenu.xib (English)" and put together your interface. We're going to make a tag editor, so give yourself a window with:
- Text fields for things like: Name, Artist, Album, Track Number, Genre.
- Buttons for two actions: Revert and Save & Close.
- Menu items for: Open, Save, Revert to Saved, Close. Keep the edit menu, window menu, and help.
If you prefer, use mine. It already as all the needed connections made, the code is all that is missing.
Now we will start the controller. Create a new file for the project of the type "Python NSWindowController subclass". Name it something like "controller.py".
To tell ...
Building Cocoa GUIs in Python with PyObjC, Part One
Introduction
Building GUIs for Apple OS X traditionally meant you would code in Objective C. To overcome this issue people have made programming bridges to allow development in other languages. PyObjC is the project that enables Python programmers to take advantage of Cocoa, Apple's development environment. I recently began learning how to use PyObjC, and how to make (almost) pure Python GUI applications.
PyObjC isn't new, it has been around for a while, and there is actually a pretty good tutorial for wiring an interface up with Python. Leopard (10.5) ships with Python 2.5 and PyObjC 2.0, meaning there is nothing we need to install. Additionally Apple has also shipped support for Python in Xcode. This makes certain things much easier.
The current tutorial directs a user to build an interface, and then take the generated Nib file* and run a script that generates the ...

