CLIM mail archive

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

Questions on Pixmaps & Output Recordin



    Date: Tue, 26 Oct 1993 18:24 EDT
    From: Land Fleming <fleming@mickey.jsc.nasa.gov>

    I'm working in Genera 8.3 on Symbolics, CLIM 2.0

    I would like to be able to have an output record that displays a fancy pixmap. 
    On my 1st attempt to do this I thick-headedly wrote:

      (with-output-to-output-record (...)
	    (copy-from-pixmap ...))

    This just produces an empty record of 0 area. I later noticed that the manual 
    explicitly states (as Scott McKay would say) that pixmaps cannot be captured by output 
    recording. This seems to be a rather severe limitation on the usefulness of pixmaps.

Symbolics will be releasing a new version of CLIM (heck, maybe we'll call
it CLIM 2.1) in the next few months.  In addition to the many bugfixes,
it will also include DRAW-PIXMAP[*], which is exactly what you want.

I have to say that your proposed solution is cool and hairy, but it's
not really right.  A pixmap output record is simply a leaf record, and
not different from, say, a line or string output record.

    I decided to improvise my own solution, based on defining a
    Standard-Sequence-Output-Record subclass, "Pixmap-Record", with a slot called "pixmap", 
    and a Replay-Output-Record :AFTER method that simply copies the pixmap in the pixmpa slot 
    to the window every time it is called. This worked to a limited extent. However, I found 
    that the stream-replay method does not really replay all output records in the window, so
    any time a function calls stream-replay or window-refresh,
    or any time the user does a <function> <refresh>, the pixmaps disappear.

    To get around this, I then wrote an :AFTER method on stream-replay that walks down 
    the output history tree of an application pane calling Replay on output records. 
    Since not all of my application panes will display pixmaps, I defined a subclass of 
    CLIM:Application-Pane called "Pane-with-Pixmap-Records," as the method specializer so that
    this class is only kind of pane that will incur the overhead of replaying each output record.
    I also intend to define a subclass of CLIM:Standard-Presentation, say 
    "Presentation-With-Pixmap-Records", to further restrict the tree walks to only those
    presentation that are known to have Pixmap-Records. 

    This appoach works, although there is still one hitch: the instances of 
    Pane-with-Pixmap-Records created in the application frame definition by calling 
    make-pane will not take the :SCROLL-BARS argument. Apparently, :SCROLL-BARS is not 
    actually an CLOS initarg and it is only accepted by the built-in classes of CLIM panes.

    Based on all this I have a three questions (in order of increasing generality):
    (1) Is there any way to get scroll bars and other pane options for programmer-defined
    pane subclasses such as my Pane-with-Pixmap-Records?

MAKE-PANE is the raw, pane creating macro.  :SCROLL-BARS is only
applicable to the MAKE-CLIM-STREAM-PANE macro.  It causes a separate
pane to be created that holds the scroll bar(s) and the viewport.

    (2) Is there a better approach to integrating pixmaps with CLIM's output recording system
    than the one I've outlined here?

Yes.

    (3) Are there any plans to extend CLIM to do this integration?

Yes.

    Since I was able to come up with a half-baked integration scheme in a few hours, it seems to 
    me that it would be no great undertaking for CLIM's authors to do a fully-baked job and 
    that a great many users would want such capabilities. 

I will send you the DRAW-PIXMAP[*] code if it is important that you
have it now.

References:

Main Index | Thread Index