How to disable editing in the comment dialogue box

131 views
Skip to first unread message

zhengyang zhuang

unread,
Nov 22, 2023, 10:27:22 PM11/22/23
to Blockly
Hello,

May I know how to disable editing in the comment dialogue box? 

Thank you sincerely for your response.

4409846d-fca1-4037-aee2-d834331c60a9.jpeg

Neil Fraser

unread,
Nov 23, 2023, 2:01:54 AM11/23/23
to blo...@googlegroups.com

To clarify, you want a read-only comment that can be opened and closed and moved and resized, but can't be deleted?


--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/6f58ec70-f397-4710-9c29-d512a649de83n%40googlegroups.com.

zhengyang zhuang

unread,
Nov 23, 2023, 3:36:47 AM11/23/23
to Blockly
Yes, what you said is exactly what I need.

Christopher Allen

unread,
Nov 23, 2023, 4:28:24 PM11/23/23
to blo...@googlegroups.com
Hi  Zhengyang Zhuang,

May I know how to disable editing in the comment dialogue box?  
To clarify, you want a read-only comment that can be opened and closed and moved and resized, but can't be deleted?
Yes, what you said is exactly what I need.

The current implementation of CommentIcon creates an editable bubble only if the block itself is editable, so the simplest thing is to make the block non-editable—but since that has other consequences that you may not desire, another approach would be to create a custom icon type by subclassing CommentIcon and overriding the setBubbleVisible method so that it always creates a non-editable bubble.


Best wishes,

Christopher

zhengyang zhuang

unread,
Dec 1, 2023, 4:47:25 AM12/1/23
to Blockly
Thank you very much for your reply :)
Reply all
Reply to author
Forward
0 new messages