Building Cocoa GUIs in Python with PyObjC, Part Four
Creating an Open Dialog
Our controller doesn't really do anything at this point. We'll begin by adding an open dialog for the user. This will require us to really delve into the Objective C bridge provided by PyObjC. We'll start by reading some documentation that ships with Xcode.
Let's launch the local documentation browser in Xcode. Under "Help" click "Documentation". In the newly opened documentation browser select the "Mac OS X 10.5" documentation set and search for NSOpenPanel. This is the class we'll be working with to create our open dialog. Have a look through the documentation, then let's code.
First we do some basic stuff, creating the object and setting some permissions. A modified open method on our controller.py looks like this:
filetypes = ('mp3', 'ogg', 'mp4', 'flac', 'm4a', 'm4p')
@IBAction
def open_(self, sender):
panel = NSOpenPanel.openPanel()
panel.setCanChooseDirectories_(NO)
panel ...
My iPhone 3G Buying Experience
I've been reading various responses to the iPhone 3G activation issues. These range from "my phone is a brick," "the store won't sell any that aren't activated," to "the line barely moves." I had a different experience yesterday morning out here in California.
I went to the smaller local Apple store in the Stanford Shopping Center. The line started at 5 AM (mall rules) and my friend and I got there at 7 AM. We were around the 100th in line. Around 9 AM the Apple employees started to alert people that if they had a business discount on their phone they needed to call AT&T and get it removed. So I called and in 5 minutes I got the PLU number removed from my account. I got into the store at 9:45 AM, and quickly bought my 8 GB. The employee helping me told ...

