PHP-GTK, Widgets & Gadgets: An Interview With Elizabeth Smith
Sumana Harihareswara interviews Elizabeth Smith, maintainer of PHP-GTK, and discusses PHP-GTK and its future.
I recently chatted with Elizabeth Smith, maintainer of PHP-GTK. PHP-GTK is, as the website describes, “an extension for the PHP programming language that implements language bindings for GTK+. It provides an object-oriented interface to GTK+ classes and functions and greatly simplifies writing client-side cross-platform GUI applications.” Smith talked about the extension, its history and future, GTK in general, open source on Windows, and what you can do to help PHP-GTK.
Smith started off by describing PHP-GTK and how she got into it:
PHP-GTK is generally best suited for situations when you already have a lot of developers (or a lot of logic) already tied up in PHP. It makes it easy to whip up a desktop interface to that business logic without the need to expose that logic via a service or learn a new language. Personally, I got involved in PHP-GTK just to learn desktop programming. I didn’t want to learn a new paradigm (web to desktop) and a new language at the same time. I started PHP-GTK to learn desktop programming without learning a new language… and ended up learning C and being the PHP-GTK maintainer. Funny how that happens.
Can you give me a specific example of an app you’ve written or worked on that uses PHP-GTK?
If you want specific applications, I tend to do little more than play with PHP-GTK, since it isn’t my day job. However, there are quite a few people using it to write “real” applications. http://php-gtk.eu/en/apps is a community site for PHP-GTK and has quite a few open source applications written with PHP-GTK. One pretty amusing thing is a friend of mine has an OpenMoko phone. He ended up getting PHP-GTK running on his phone and wrote a couple more apps as well. But the only PHP-GTK code I write and use on a regular basis is my “demo application” – a basic Twitter client. The latest source for it is here in the zip file. I generally use it with my “PHP on the desktop” talk. I haven’t had as much time to devote to, well, anything as I’d like!
That is my “framework” for applications. It was simply a way to wrap up some of the mundane details that I was using every time I got into a PHP-GTK programs: where to save user settings, saving and restoring window positions between applications opening and closing, and so on.
What GTK apps do you & other Windows users love?
Personally? I am addicted to Pidgin. It’s on every box. Inkscape is the other big one I use. Vector graphics are fun and make my life SO much easier, and really the only thing that comes close is some horribly expensive Adobe atrocity!
So, I do have to ask, since most of GNOME Journal’s readers are running GNOME on Linux—are you choosing to use Windows, or is it something rather forced upon you?
Initially it was forced; now it’s by choice. Really I use … lots… of operating systems but for a solid desktop I still use Windows. It’s just absolutely covered in open source software (OSS on Windows – the gateway drug). And, as I’m happy to tell most people: all operating systems (and languages for that matter) basically suck. It’s just a matter of what sucks least for the problem you’re trying to solve.
Is there some initial dependency one needs to install on Windows to make GTK apps work, or is it built in?
Well, I wouldn’t say it’s a “dependency” per se, but you do need to install the GTK libraries and their “stack.” On most Linux systems this comes all built in, since they’re already installed for GNOME (or often side by side with KDE). But it’s no different than, say, on a Mac. GTK is smart enough to speak Windows; you just have to get everything compiled and installed. It’s just about 13MB for all the GTK libraries, the PHP runtime, and the PHP-GTK extension on Windows. When I package PHP-GTK for Windows, it’s all in there. You literally unzip and run. (A small advantage of having a native Windows person as lead.)
So, I asked the #gnome-hackers channel on GNOME IRC for some questions for you. One question, from Rob McQueen: “are they aware of the gobject introspection work, and do they have any plans to rebase the bindings on top of that to access the whole GNOME platform?”
Actually – yes, we’re aware of the introspection work, and we’re working on a new “stack” that splits up PHP-GTK into more “pieces”—there are already glib and gobject components started doing that—however, because of the tight ties PHP uses, it’s not going to work to do runtime level introspection. Instead it will be tied into our code generation stuff. We have a real problem with the current introspection stuff though that I’d personally give my right eye to have fixed. We support lots and lots of GTK versions. We really really need version information available to us.
So other people who are interested in PHP & GTK should feel free to jump in and help fix that?
Sure. There is a running joke right now that if you come to freenode, join #php-gtk and mention “I want to help” you’re hired. Really, though, what we need is the “fun work.” PHP-GTK is fairly stable now and bugs are scarce, so we just need people willing to help write the next iteration. Because of the nature of GTK, PHP-GTK previously had all of its pieces tied up in one monolithic extension. Recently we’re been working on “splitting off” functionality, so there is now a Cairo PHP extension, which basically the PHP-GTK folks are taking care of. And pango, and, as I mentioned, a gobject and glib. So, we’re breaking out the pieces – to make it easier to maintain, make it easier to add new features (because all these GTK libraries are often released separately), and add additional GNOME-level library bindings. Well, they’re not really “GTK” libraries, they’re stuff on the GTK stack. But that means basically redoing almost all of PHP-GTK … and no one really likes a rewrite.
One person asked whether PHP-GTK is maintained.
Define “maintained.” There are three of us basically that still hack on the source. We have a release that’s currently been waiting for me to get enough time to get the Windows builds going so we can get a release done. If there are bugs, they are fixed (check the
bugtracker) – they always get priority. However, it’s new features that really suffer when the developer pool is that small. So it’s not abandoned, it’s just really slow development, a lot of which depends on my load at work (which has been far too high recently). Open source work for me is all after hours, while I’m folding laundry, etc.
Come join. I love new devs. No, we’re not dead, just short on manpower.
I’d like to hear about what you like & don’t like about GTK.
What I like? Cross-platform support, the fact that it’s written in C and so is very easy to stick in anything, lots of features, the general gobject design itself. What I hate? Not a lot of good Windows devs (regressions are the bane of my life), non-standard file and print dialogs, building the sucker with Visual Studio (owie), sometimes too many features. Take a look some time at the number of widgets available in GTK, plus all the deprecated stuff is still there… it’s just huge. Sometimes I think it would be smarter for some of the more advanced widgets to be broken off.
And that’s another thing that I think could be a great strength of GTK, but the community doesn’t seem to be there – additional widget libraries.
I liked having things like libsexy that gave nice new features—but they weren’t in the core if I didn’t need them! I guess what I’m trying to whine about is that I’d appreciate more modularity, and some kind of a community to then allow those who extend and enhance to have a place to “display their wares.” An app store for widgets? Heh!
When you want to find widgets, how do you currently find them? Are there any IRC channels, planets, mailing lists, or Usenet groups?
Right now it’s a Google nightmare. Either I see something cool in a search engine I want, or someone comes to PHP-GTK and says “this widget here, I would like wrapped.” Communities—not that I know of. Now, that just might be because I don’t know where the official place is, but that is not something where I’ve seen any coherence in the community.
So a little about you, now. It sounds like you do a lot of web programming?
I do a lot of… everything, but I started in web programming and that’s my “day job.” I’m in the US, in Michigan, in a tiny little town with lots of corn. I work remotely, which is nice because I”m juggling a full time job, four kids, plus as much open source work as I can do and not make my husband overly irritated.
I’m also involved in the PHPWomen user group, speak at conferences, and recently threw my hat into the CoApp project (Common Opensource Application Publishing Platform)—“apt-get for Windows,” in Linux speak! Windows needs it. Would help open source for the Windows platform in so many ways. I just got back from the design summit; we’re currently working on the API for the engine core. We need C devs who aren’t afraid of Windows, and those are hard to find.
Are any of your kids showing signs of turning into geeks?
Oh yes. Let’s just say my four year old gets up in the morning, logs on, and goes to nickjr.com without any intervention… And my oldest son wants to be an engineer and builds motion detectors out of snap circuits to keep his brothers out of his room!
So, one last question—your gadgets! What gadgets do you love right now?
I’m currently in love with my very strange setup in the basement: I have a very large server, running HyperV (2008 Windows hardware-based VM stuff), and I have so many versions of Unix and Linux on there it makes me chuckle. Nothing like booting FreeBSD on a Windows box to make you feel subversive.
About the Author
Sumana Harihareswara manages projects and people. She has worked at Collabora, Fog Creek Software, and Salon.com, and contributed to the AltLaw, Empathy, Miro, and Zeitgeist open source projects. She is currently an editor for GNOME Journal and a blogger at GeekFeminism. She blogs at Cogito, Ergo Sumana and microblogs at Identi.ca.