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.
Any idea/help/example?
Thanks,
Yoel
You should ask this on the mcclim-devel mailing list instead; chances
are you'll get better help there.
http://common-lisp.net/mailman/listinfo/mcclim-devel
-Peter
"Yoel Jacobsen" <·············@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
--
Why Lisp? http://lisp.tech.coop/RtL%20Highlight%20Film
Recommended Common Lisp libraries/tools (see also http://clrfi.alu.org):
- ASDF/ASDF-INSTALL: system building/installation
- CL-PPCRE: regular expressions
- UFFI: Foreign Function Interface