简体   繁体   English

如何清除R tcltk2,tcltk中的tk2文本框

[英]How to clear tk2text box in R tcltk2, tcltk

I am trying to clear the content of a text box which i created using 我正在尝试清除我使用创建的文本框的内容

Window_1$env$txt1 <- tk2text(Window_1, width = 90, height = 1)

I can update the values using 我可以使用更新值

tkinsert(Window_1$env$txt1 "end", "test")

But can someone help me how to clear the contents of Window_1$env$txt1 但是有人可以帮助我如何清除Window_1 $ env $ txt1的内容

Cheers :) 干杯:)

I found the answer :) to delete the text box I have to use tkdelete 我找到了答案:)删除文本框我必须使用tkdelete

tktag.add(Window_1$env$txt1, "sel", "0.0", "end") #tagging the selecting
tkdelete(Window_1$env$txt1, "sel.first", "sel.last")
tkinsert(Window_1$env$txt1, "end", "new_text")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM