CLIM mail archive


Strange accepting-values behavior (and more)

I'm using Franz CLIM 1.1 on a Sparc 1+ with Allegro CL 4.1.  I have a
couple of questions/comments:

1.)  I am working on a type of graph editor using CLIM.  I have defined
a new gesture which I call :part.  I also have a command com-attach-part
which takes one argument, the part to attach.  The command can either be
invoked via menu or by using the :part gesture on an appropriate object.
The command is designed to attach the selected object to the current
focus object in the graph.  The command pops up an accepting values
dialog (:own-window t) to allow the user to customize the interaction
between the part and the focus object.  Two of the accepts in the dialog
look like this:

(setq rel
  (accept '(member = < > <= >= /=)
          :stream stream
          :default rel ;; initially '=
          :provide-default t
          :insert-default t
          :prompt "Number of occurrences must be"))
(princ " " stream)
(setq comp
  (accept 'number
          :stream stream
          :default comp ;; initially 1
          :provide-default t
          :insert-default t
          :prompt nil
          :display-default nil))

Two things:

If the command is activated via the menu, the relevant section of the
dialog looks like this:

Number of occurrences must be: =
                               /= 1

If, instead, the gesture is used to invoke the command, the dialog looks
like this:

Number of occurrences must be: = < > <= >= /= 1

which is what I want all the time.  Why are the two different?

Second, the = is not initially highlighted.  If I select something else,
that gets highlighted.  If I then re-select =, it is not highlighted.
Any ideas?  Or is it that the bolding of the = sign just doesn't show up
on my display?

2.)  This is more of a comment.  I use define-border-type to define a
new border type for nodes in my graph.  Here is the code:

(clim:define-border-type :ellipse (stream record left top right bottom)
  (declare (ignore record))
  (let ((cx (/ (+ left right) 2))
	(cy (/ (+ top bottom) 2))
	(rx (+ 8 (/ (- right left) 2)))   ;; the 8 is to ensure that the
	(ry (+ 8 (/ (- bottom top) 2))) ) ;; ellipse surrounds the text
    (clim:draw-ellipse* stream cx cy rx 0 0 ry :filled nil))

When this code is compiled, the declare form is ignored and I still get
a warning message about not using record.  I'm not sure if this is a
general CLIM issue, or if it is specifically related to Franz's version.
It doesn't cause a crash, but I pride myself on writing "warning-free"
code and this warning message violates that.

Thanks for any help,

Randy A. Coulman                |       ARIES Laboratory
                                |       Department of Computational Science             |       University of Saskatchewan
                                |       Saskatoon, SK   S7N 0W0             


Main Index | Thread Index