Thursday, April 9, 2009

Sufficiently advanced programming

[...] but unfortunately the event subsystems of the latter two are fundamentally incompatible.

... wait, aren't we using both of them now? How did you get it to work?

Me? Heavy wizardry, deep magic, and voodoo.

[laughs] Well, yeah, but specifically?

Well, the heavy wizardry is actually one of the canonical examples of heavy wizardry in the Jargon File: knowing how to interface to X11 without a toolkit. I have to a) manually track down the windows and/or pseudowindows for which each event is intended — which is not always the one named in the event, unfortunately — b) determine which toolkit or toolkits those windows belong to, and then c) get those toolkits to accept the event as though they had each retrieved it with their own event loops. So heavy wizardry in a) and c), deep magic in b) and c).

So where's the voodoo come in?

Oh, that's getting all three toolkits to run without their own event loops active. Which is easy enough for Xt — it's documented; they basically expect you to replace it — but the other two... yeah, notsomuch. So to take care of that, I have two minor loa in my stomach, one for each of them. They keep the program working, and I supply them with Mountain Dew.

...

What, you didn't think I could drink all that Dew myself, did you? Anyway, yeah, that's why SE2 was having problems on Saturday, and why they're not seeing those problems today, now that I'm in. Just let them know that they can't use the app on weekdays or holidays for now, and it'll be taken care of in the next version.

...

... Jim? Are you okay?

No comments: