How to make an output-pane interact with layouts?
Matthew Lamari <matt.lamari <at> gmail.com>
2007-07-08 18:35:22 GMT
Consider this code with buttons (I've tried to condense it):
(use-package "CAPI")
(contain
(make-instance 'row-layout
:description
(loop for i from 1 to 6 collect
(make-instance 'push-button :text "Hello There,
Everybody"))))
Simple - 6 buttons drawn in a non-overlapping fashion.
(contain
(make-instance 'row-layout
:description
(loop for i from 1 to 6 collect
(labels ((draw-text (self)
(gp:draw-string self "Hello There, Everybody"
0 (gp:get-font-ascent self) )))
(make-instance
'output-pane
:display-callback
(lambda (self &rest ignore) (draw-text self)) )))))
Here, the draw-panes overlap - that is, their size is not used as a
basis in their positioning. The "Hello There, Everybody" text is
partially obscured/covered by the next one.
How can I rectify this, and reliably notify the layout on startup (and
potentially on change) of the size of the output-pane?
(Apologies to Nick L. for not getting back on this sooner, and thanks
again for his excellent code sample upon which this is based)
Thanks,
Matt