更改 Allegro CL 中的可编辑文本值

发布于 2024-08-20 14:34:31 字数 864 浏览 6 评论 0原文

我试图通过单击默认按钮来更改 Allegro CL(版本 8.0.1)中可编辑文本控件的值。

我已阅读有关 (setf value) 但尚未找到任何示例。

我附加到点击事件的函数如下

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

    t)

如您所见,其中缺少代码:)我尝试了各种方法,如 (setf (slot value :txt 'value) 'TEXT)(setf value 'TEXT) 但无济于事。

表单上的对话框项目槽是一个列表,其中包含由

(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 "")
 )

任何帮助定义的以下元素?提前致谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

沦落红尘 2024-08-27 14:34:31
(setf (slot-value widget 'value) "foo")

像上面这样的东西。您需要在正确的包中获取符号值。可能还有一个像 WIDGET-VALUE 这样的访问器函数。然后 (setf (widget-value widget) "foo") 可能会起作用...

我不是 ACL 用户 - 可能有更好的方法。 ACL 特定问题最好在其用户邮件列表上询问。

(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.

世界和平 2024-08-27 14:34:31

在 franz.com 上有一个例子,我发现了这个:

(defun form1-button5-on-change (widget new-value old-value)
  (declare (ignorable widget new-value old-value))
  (let ((szerkeszto (find-sibling :multi-line-editable-text-1 widget)))
    (setf (value szerkeszto) "bla" ))
  t) ; Accept the new value

符号“szerkeszto”变成了 multi-line-editable-text-1,然后你可以像上面一样使用 setf 来设置适当的属性(如“value”)。

希望这有帮助。

There is an example somewhere on franz.com where I found this:

(defun form1-button5-on-change (widget new-value old-value)
  (declare (ignorable widget new-value old-value))
  (let ((szerkeszto (find-sibling :multi-line-editable-text-1 widget)))
    (setf (value szerkeszto) "bla" ))
  t) ; Accept the new value

symbol "szerkeszto" becomes the multi-line-editable-text-1, then you can use setf like the above to set appropriate attributes (like "value").

hope this helps.

吻风 2024-08-27 14:34:31

您需要一起使用“find-component”和“value”函数。

函数“find-component”在您的项目中查找小部件
“value”返回小部件的值。

如果表单中有静态文本,则可以像这样更改静态文本的值。

(let ((ed1 (查找组件:static-text-1:form1)))
(setf (value ed1) “我做到了。”))

You need to use the functions "find-component" and "value" together.

The function "find-component" finds the widget in your project
and "value" returns the value of the widget.

If you have static-text in a form, you can change the value of the static-text like this.

(let ((ed1 (find-component :static-text-1 :form1)))
(setf (value ed1) "I made it."))

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文