Lisp HUG Maillist Archive

Generic callback for text-input-field

Hey,

I have several text-input-fields defined and want to use a callback to
fill them. I would like to write a generic callback so that I don't
need to defun a callback for every single textfield. Is there maybe a
way to pass an own argument to the callback then those defined via
callback-type?

Best Regards,
Phil

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Generic callback for text-input-field

Unable to parse email body. Email id is 13056

Re: Generic callback for text-input-field

Hi Martin,

thank you for the hint. I already used the :callback-type :element.
But your hint gave me another idea how to solve it. I thought I needed
to get the name of my defined text-input-pane to set the new text, but
via the text accessor I just need the element itself.

Slowly my experience grows ;-)

Thank you,
Phil

On Wed, May 21, 2014 at 6:53 PM, Martin Simmons <martin@lispworks.com> wrote:
>
>>>>>> On Wed, 21 May 2014 15:26:26 +0200, Philipp Bach said:
>>
>> I have several text-input-fields defined and want to use a callback to
>> fill them. I would like to write a generic callback so that I don't
>> need to defun a callback for every single textfield. Is there maybe a
>> way to pass an own argument to the callback then those defined via
>> callback-type?
>
> Hi Phil,
>
> You can use :callback-type :element (see
> http://www.lispworks.com/documentation/lw61/CAPRM/html/capiref-26.htm).
>
> --
> Martin Simmons
> LispWorks Ltd
> http://www.lispworks.com/
>
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
>

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Generic callback for text-input-field

It might be worth looking into alternative values for :callback-type - that might give you the context that your callback requires.


On Thu, Jun 5, 2014 at 1:50 PM, Philipp Bach <philipp.wilfried.bach@gmail.com> wrote:

Hey,

I think that I need your help again understanding callbacks. I have
several text-input-panes defined like this:

   (text-pane-invoice-no capi:text-input-pane
                         :buttons '(:ok t)
                         :callback 'tdi++callback
                         :callback-type :element
                         :accessor text-pane-invoice-no)

I don't want to define an own callback function for every pane. But I
need to pass something like a key to the callback function.

I have something like this in mind:

(defun tdi++callback (element key)
    (cond ((eq key :a)
                ....)))

I don't see how I can achieve that or if it is possible at all. And all
the possiblities at
http://www.lispworks.com/documentation/lw61/CAPRM/html/capiref-26.htm
confuses me bit.

Any Ideas?

Best regards,
Phil

Am 22.05.2014 11:10, schrieb Philipp Bach:
> Hi Martin,
>
> thank you for the hint. I already used the :callback-type :element.
> But your hint gave me another idea how to solve it. I thought I needed
> to get the name of my defined text-input-pane to set the new text, but
> via the text accessor I just need the element itself.
>
> Slowly my experience grows ;-)
>
> Thank you,
> Phil
>
> On Wed, May 21, 2014 at 6:53 PM, Martin Simmons <martin@lispworks.com> wrote:
>>>>>>> On Wed, 21 May 2014 15:26:26 +0200, Philipp Bach said:
>>> I have several text-input-fields defined and want to use a callback to
>>> fill them. I would like to write a generic callback so that I don't
>>> need to defun a callback for every single textfield. Is there maybe a
>>> way to pass an own argument to the callback then those defined via
>>> callback-type?
>> Hi Phil,
>>
>> You can use :callback-type :element (see
>> http://www.lispworks.com/documentation/lw61/CAPRM/html/capiref-26.htm).
>>
>> --
>> Martin Simmons
>> LispWorks Ltd
>> http://www..lispworks.com/
>>
>> _______________________________________________
>> Lisp Hug - the mailing list for LispWorks users
>> lisp-hug@lispworks.com
>> http://www.lispworks.com/support/lisp-hug.html
>>

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Updated at: 2020-12-10 08:34 UTC