views:

49

answers:

1

I'm trying to change the value of an Editable-Text control in Allegro CL (version 8.0.1) by clicking a Default-Button.

I've read about (setf value) but haven't found any examples.

The function I have ttached to the on-click event is the following

    (defun form1-default-button-2-on-click (dialog widget)
       (declare (ignorable dialog widget))

    t)

As you can see there's a lack of code in there :) I've tried various methods as (setf (slot value :txt 'value) 'TEXT) and (setf value 'TEXT) but to no avail.

The dialog-items slot on the form is a list with the following elements defined by

(list (make-instance 'default-button :font
                   (make-font-ex nil "Segoe UI / Default" 12) :left
                   56 :name :default-button-2 :on-change
                   'form1-default-button-2-on-change :top 36)
    (make-instance 'editable-text :font
                   (make-font-ex nil "Segoe UI / Default" 12) :left
                   52 :name :txt :top 152 :value "")
 )

Any help? Thanks in advance.

+1  A: 
(setf (slot-value widget 'value) "foo")

Something like the above. You need get the symbol value in the correct package. probably there is also an accessor function like WIDGET-VALUE . Then (setf (widget-value widget) "foo") might work...

I'm not an ACL user - there are probably better ways. ACL specific questions are best asked on their users mailing list.

Rainer Joswig
The solution with 'slot-value' doesn't work nor does the one with widget-value.
foliveira
It was a hint, but you really should use the mailing list for ACL. http://www.franz.com/support/acl.forum.lhtml
Rainer Joswig