From: Yoel Jacobsen
Subject: McCLIM: subclassing text-field?
Date: 
Message-ID: <1114703927.302113.127990@z14g2000cwz.googlegroups.com>
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

From: Peter Scott
Subject: Re: McCLIM: subclassing text-field?
Date: 
Message-ID: <1114717067.960683.149110@g14g2000cwa.googlegroups.com>
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
From: Paolo Amoroso
Subject: Re: McCLIM: subclassing text-field?
Date: 
Message-ID: <8764y5x5w4.fsf@plato.moon.paoloamoroso.it>
"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