[mcclim-devel] Subclassing text-field?

Paolo Amoroso amoroso at mclink.it
Fri Apr 29 09:59:23 UTC 2005


I have just posted this reply to your comp.lang.lisp thread.


Paolo

------------------------------------------------------------------------
"Yoel Jacobsen" <yoel.jacobsen at gmail.com> writes:

> I would like to have a numeric-only text-field. I want it to return
> numbers with gadget-value, and to be able to setf it with numbers (and
> not strings). Is subclassing text-field (and text-field-pane?) and
> defining gadget-value and (setf gadget-value) the solution? If so, it
> seems to be more complicated than I thought.

Off the top of my head, this should work.  A possibly more idiomatic
way would be to put something like this into an accepting-values form:

  (let (my-number)
    (setf my-number (accept 'number :stream stream
                                    :prompt "Insert a number "
                                    :default 0)))

But, if I understand correctly, McCLIM currently has a couple of
limitations:

- accepting-values is not fully implemented, and it does not use
  gadget views (this mostly mean that the look may not be pretty)
- restrictions on the type of accepted value are not enforced, and
  only a warning message is printed

As has been suggested, you may get additional feedback from the McCLIM
mailing list.


Paolo
------------------------------------------------------------------------

-- 
Lisp Propulsion Laboratory log - http://www.paoloamoroso.it/log



More information about the mcclim-devel mailing list