Lisp HUG Maillist Archive

CAPI / Dynamically changing push-button slots


Hi,

Is there anyway to dynamically modify buttons in CAPI :

CL-USER 18 > (let ((b (make-instance 'push-button :text "foo")))
               (contain b)
               (setf (slot-value b 'capi::text) "bar"))
"bar"

I was naively trying to implement a toggle effect : changing both the
text and the selection-callback slots. 

I also tried to play with (redisplay-interface *my-interface*) because I
but without any effect apparently. LWW 5.0 is it matters.

Regards and thanks for any clue,

-- 
Fabrice Popineau
------------------------
e-mail:       Fabrice.Popineau@supelec.fr  |  The difference between theory 
voice-mail:   +33 (0) 387764715            |  and practice, is that
surface-mail: Supelec, 2 rue E. Belin,     |  theoretically,
	      F-57070 Metz 	           |  there is no difference !


Re: CAPI / Dynamically changing push-button slots

On Wednesday 11 October 2006 05:22 pm, Fabrice Popineau wrote:
> Hi,
>
> Is there anyway to dynamically modify buttons in CAPI :
>
> CL-USER 18 > (let ((b (make-instance 'push-button :text "foo")))
>                (contain b)
>                (setf (slot-value b 'capi::text) "bar"))
> "bar"

The examples given in the capi ref use capi:apply-in-pane-process to alter 
widgets (for example, see the examples under text-input-pane).

That may have something to do with your problem.  The container (interface) is 
in a different process than the listener, so you have to do the setf in the 
process of the container using magic.

pt


Re: CAPI / Dynamically changing push-button slots

On Wed, 11 Oct 2006 23:22:49 +0200, Fabrice Popineau <Fabrice.Popineau@supelec.fr> wrote:

> Is there anyway to dynamically modify buttons in CAPI :
>
> CL-USER 18 > (let ((b (make-instance 'push-button :text "foo")))
>                (contain b)
>                (setf (slot-value b 'capi::text) "bar"))
> "bar"

This version works for me:

  (let ((b (make-instance 'capi:push-button :text "foo")))
    (capi:contain b)
    (setf (capi:item-text b) "bar"))

Cheers,
Edi.


Re: CAPI / Dynamically changing push-button slots

* Edi Weitz <edi@agharta.de> writes:

    > This version works for me:

Oh, perfect. Thanks. And now I see how things are composed.

Fabrice


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