更改 Allegro CL 中的可编辑文本值
我试图通过单击默认按钮来更改 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
像上面这样的东西。您需要在正确的包中获取符号值。可能还有一个像 WIDGET-VALUE 这样的访问器函数。然后 (setf (widget-value widget) "foo") 可能会起作用...
我不是 ACL 用户 - 可能有更好的方法。 ACL 特定问题最好在其用户邮件列表上询问。
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.
在 franz.com 上有一个例子,我发现了这个:
符号“szerkeszto”变成了 multi-line-editable-text-1,然后你可以像上面一样使用 setf 来设置适当的属性(如“value”)。
希望这有帮助。
There is an example somewhere on franz.com where I found this:
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.
您需要一起使用“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."))