Notes on McCLIM : day 1
Thu, 17 Jul 2003 02:58:16 +0000
Notes on McCLIM : day 1
I'm using SBCL approximately-0.8.1, telent CLX (CVS version, but it's near enough the current release) and McCLIM anon-cvs of approximately whenever this diary entry is made. SBCL is compiled with the :sb-thread feature. The assumptions I've made so far may be horribly horribly wrong, but it seems to be working. I probably won't come back and revise this at a later date as I find out more, so do be sure to read later diary entries if you stumble across this significantly later than I'm writing it and are expecting to depend on anything you learn here.
To build McCLIM, (load "system") then (asdf:operate 'asdf:load-op :clim-clx). Don't bother installing mk-defsystem, someone's passed this way with asdf already. OK, that might have been me in an earlier life
It's visibly faster than it used to be.
The first two chapters of the manual (in McCLIM Doc/) have a worked example, which is worth looking at. Note that the output from the parity command is only displayed very very briefly. If you'd like to actually see it, add the option
:display-time nilto the define-application-frame / :panes / app form. This stops the default refresh stuff from blanking it out as soon as it's rendered.
Some layout monkeying was needed, in define-application-frame. Note that
- the modus operandi seems to be that (1) the interesting panes get named in the :panes clause, then (2) the :layouts clause describes one or more arrangements for how to fit them together. In this case we have a single layout called default. The layouts clause actually introduces more panes for layout control, but they don't get names. vertically and suchlike are actually macros that expand into calls to (make-pane 'some-pane-type ...): although it looks fairly declarative at the front, that's just a front.
- we've chosen a non-Courier font. This is Required :-)
- scrolling in the layout puts a scroller-pane around our journal - i.e we now have scroll bars. We disable the scrollbar for the inner journal (there was only a vertical scrollbar to start with) because it was always coming out with the thumb the same size as the pane, so no actual scrolling movement was available from it.
Our goal here is a new frontend for the metacircles bookkeeping system (actually, the real goal is just to print out a couple of invoices, this whole clim thing is so much sidetrack. But anyway) so we really want most of the application pane to be showing the same thing most of the time, instead of being dribbled into by various commands. So, remove :display-time again and replace with :display-function 'display-journal. Now we just have to write a display-journal method that does the business.
display-journal depends quite heavily on some kludgey macros I wrote a couple of weeks ago to sit atop Eric Marsden's pg.lisp. You don't see them here, and they aren't yet available anywhere else (though will be, someday, when they're cleaner). Regardless, it should be fairly obvious what they do.
Look at the presentation types! I don't know if this is actually a sensible use for them: I haven't worked out how to get these not to be higlighted when moused-over yet; I thought the :single-box nil ould do that, but it doesn't. In the meantime, notice that you need to define a presentation type, then a bunch of methods on it to tell the system how to present it and how to input it. We've only done the present method for these so far.
Fell into a what-strange-thing-is-clim-doing-now trap for too long, before realising that the problem was pg (or, just as likely, my glue for it) catching errors and throwing them away without telling me something had gone wrong. This made it difficult to work out why it had suddenly stopped wanting to print anything other than the column titles.
There is a problem with the queuing/refresh. This manifests in two ways
- First, refresh doesn't always happen until the next time the application gets some events (mouse movement or keys or suchlike)
- Second, more rarely, something iffy in the bowels of SBCL or CLX makes it hang every so often (not usually all that often, but it varies). killall -CONT sbcl from the command line tends to unstick it in those cases.
Ok, that's enough for one evening.