[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Cell-select/deselect
- To: info-mcl@cambridge.apple.com (Macintosh Common Lisp)
- Subject: Re: Cell-select/deselect
- From: cartier@math.uqam.ca (Guillaume Cartier)
- Date: Mon, 27 Apr 92 10:35:00 -0400
>Am I reading the manual wrong? When I set up :before and :after
>methods for cell-select and cell-deselect for SEQUENCE- and
>TABLE-DIALOG-ITEMs, they are never called, no matter what the
>user clicks on. A quick trace reveals that these functions are not
>called during normal use of these items. I had assumed that these were
>the top-level functions called whenever a cell was being selected.
>Enlightenment anyone?
What mislead you (as it did me a few times), is the fact that
the name of many MCL interface generic functions like CELL-SELECT,
seems to imply that the system goes through them to accomplish
their specified actions.
For CELL-SELECT, it does not. CELL-SELECT is simply a function
that enables you the programmer, to select a specific cell. The
MCL system does not call it when the user selects a cell.
I suppose (and hope), that the documentation for MCL 2.0 final,
will make very clear which generic functions are used by the
system to do their task and which are just there for us to use.
Back to your problem, if you want to do some action when the user
selects a cell, the standard way for all dialog items to do so,
is to define a DIALOG-ITEM-ACTION for it.
The following example should make everything clear:
(defclass my-table-dialog-item (table-dialog-item)
())
(defmethod dialog-item-action ((self my-table-dialog-item))
(format t "~&~A click on cell ~A."
(if (double-click-p) 'double 'single)
(point-string (first (selected-cells self)))))
(make-instance 'window
:view-subviews
(list
(make-instance 'my-table-dialog-item)))
*********************************************************************
* Guillaume Cartier (514) 844-5294 (maison) *
* L.A.C.I.M. (514) 987-4290 (bureau) *
* Universite du Quebec a Montreal (514) 987-8477 (telecopieur) *
* Montreal, Quebec, Canada cartier@math.uqam.ca (internet) *
*********************************************************************