Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Learning to Program



Josh Glover wrote:
> Seriously, I actually like working in XUL. Some of the most fun I've
> ever had hacking has been hacking on Firefox and Thunderbird.

It is lovely, isn't it? It's Javascript but it doesn't suck!

> What are your thoughts on XUL and XBL, having just spent all day with them?

Well, it's not just all day (yesterday) but I've been working on a big
xulrunner-based project for a while. (http://songbee.simon-cozens.org/)
I think for cross-platform GUI application development, it's the least
bad platform out there. XBL I find bizarre and confusing and try to stay
away from it, but XUL is relatively straightforward. I haven't needed
XBL for anything; I've been able to do everything I need in XUL and JS.

The real problem is that a lot of heavy stuff you need to do comes
through XPCOM, and some of the standard XPCOM components aren't
particularly well documented. (On the whole, though,
developer.mozilla.org and xulplanet are fantastic resources.)

There are some weird annoyances with it, too. For instance, a problem
I'm struggling with at the moment goes like this: I want the user to be
able to theme the display, so, if there's a user stylesheet file in the
user's profile directory, we create a <link> tag referring to the file,
and insert it into the DOM tree for our display. Then we need to pull
some information out of it. But everything in XUL is asynchronous, and
so just after the <link> tag is added to the DOM, the code which tries
to read the spreadsheet runs - but at that point the stylesheet isn't
fully loaded yet. Grovelling through find Mozilla source - which is
often the only way to work out how things like the notification system
work - I find that the stylesheet code sends a notification to the
window observers when the stylesheet has finished loading. But there's
no documentation anywhere on how to implement nsIDocumentObserver from
Javascript. (So I hacked around it with a setInterval...)

Thunderbird is even worse. I had to write my own tutorial on how to GET
THE TEXT OF A FRICKIN' EMAIL
(http://simon-cozens.org/programmer/articles/thunderbird-js.pod) because
the internals documentation of even very simple stuff is non-existent.

If you're doing very simple stuff, it just works, and it's lovely. When
you get onto more complicated stuff, expect to spend three times as long
searching the web as programming.

-- 
"The best index to a person's character is a) how he treats people who
can't do him any good and b) how he treats people who can't fight back."
-- Abigail Van Buren


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links