Cocoa’s been blowing my mind

This week I spent most of my coding time trying to wrap my brain around Cocoa and pyobjc.  I figured it was going to be at least somewhat similar to GTK, but actually it’s completely different.  I’ve just been trying to get a window to pop up that displays miroguide.com, but there’s still quite a bit over my head.  Hopefully I’ll get it working in a few days, I think this first step is going to be the hardest.

In addition to coding, I’ve been spending tons of time trying to figure out how we’re going to make native widgets work.  Mostly it’s been pretty exciting for me though, since I realized that NSOutline/GTKTreeView work on very similar models and are actually much more flexible than I though.  I think they could work great for the item lists and tab lists and be super-snappy.
Lastly, I’ve been working on getting my unaccepted bugs down.  I think I’m finally in single digits now, this week is the week I finally get bugzilla to stop pestering me!

3 comments ↓

#1 marcos pinto on 04.25.08 at 3:52 am

i’d really like to hear how you get xulrunner working in pygtk. i’m *very* interested in this and appreciate your work. thanks!

#2 bdk on 05.05.08 at 12:28 am

There’s a couple hurdles to getting this to work. I just checked in a bunch of code, so you may just want to check that out. You can check out this SVN branch to play around with it:

https://svn.participatoryculture.org/svn/dtv/branches/widgets

Basically there were 3 steps:

The first step was getting an environment where XULRunner and GTK were working and I could link things together. I would recomend getting a newish XULRunner-SDK build and the prebuilt gtk-bundle for windows.

The second step was hooking up a xulrunner browser to GTK. If you search for the winEmbed.cpp test example that contains pretty good stuff. Also, you can find the code that I used here:

https://develop.participatoryculture.org/trac/democracy/browser/branches/widgets/tv/platform/windows-xul/platform/frontends/widgets/XULRunnerBrowser

Finally (and this was by far the hardest part), you need to hack around the differences between GTK’s focus model and XULRunners. Take a look at this file for what I did:

https://develop.participatoryculture.org/trac/democracy/browser/branches/widgets/tv/platform/windows-xul/platform/frontends/widgets/XULRunnerBrowser/FixFocus.cpp?rev=6844

#3 bdk on 05.05.08 at 12:29 am

Also, if you have specific questions, I’d recommend #embedding on irc.mozilla.org. There’s usually people excited to help out. I plan to be hanging out there during my workdays too.

Leave a Comment