CLIM mail archive

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

Variations on a CLIM view



CLIM 2.0-beta on LispWorks 3.2.21-beta-4
CLIM 2.0 on Allegro 4.2

The CLIM documentation doesn't seem to clearly specify the protocol
between views and gadget panes.  For example, if one has constructed a
new gadget, how does one create a view that uses that gadget, so that
"ordinary" programmers can work at the presentation (CLIM:ACCEPT)
level instead of the gadget-pane (CLIM:MAKE-PANE) level?

The most common case, actually, is that one would like to supply
non-default initargs to the gadget that implements a view.  For
example, I might need a CLIM:RADIO-BOX-VIEW with an :ORIENTATION of
:VERTICAL rather than the default :HORIZONTAL, and non-default
:FOREGROUND and :BACKGROUND colors as well.  The following appears to
work (modulo current implementation limitations):

(let ((new-view (make-instance 'clim:radio-box-view :orientation :vertical
                                                    :foreground clim:+red+
                                                    :background clim:+yellow+)))
  (clim:accepting-values ()
    (clim:accept '(member jimmy tommy larry) :view new-view)))

That is, passing the gadget-pane's initargs to a MAKE-INSTANCE on the
corresponding view-class seems to (more or less) get what I want.  Is
this the "official" way to create variations on a gadget view?


        Lawrence G. Mayka
        AT&T Bell Laboratories
        lgm@iexist.att.com

Standard disclaimer.


Follow-Ups:

Main Index | Thread Index