Re: variable Type

80 views
Skip to first unread message
Message has been deleted

Maribeth Bottorff

unread,
Nov 7, 2022, 1:15:25 PM11/7/22
to Blockly
Hello,

Unfortunately I'm not sure what you're asking for. Could you rephrase your question or add more detail? Thanks,
Maribeth

On Monday, November 7, 2022 at 1:59:09 AM UTC-8 xuew...@gmail.com wrote:
I hope that there are no methods where variables are text and displayed as parameter blocks when they are dragged out.飞书20221107-175744.jpg

薛武英

unread,
Nov 7, 2022, 8:18:27 PM11/7/22
to Blockly
What I want is that variables can be grouped and a text can be dragged to the workspace

Maribeth Bottorff

unread,
Nov 8, 2022, 3:33:37 PM11/8/22
to Blockly
Hello,

You could implement variable grouping by creating a custom toolbox category: https://developers.google.com/blockly/guides/configure/web/toolbox#dynamic_categories

The default variable category is a dynamic category, which means the contents are calculated dynamically every time the category is opened. In the default one, all the variables are together in one category. You could implement your own dynamic category that groups the variables according to your custom logic.

I'm not sure what you mean by "a text can be dragged to the workspace" -- what exactly do you want to drag, and what should happen when it is dropped onto the workspace?

Maribeth

薛武英

unread,
Nov 22, 2022, 7:41:19 PM11/22/22
to Blockly
I want to add a custom attribute to the dynamic category, such as the following icon, and then use workspace. getAllVariables () to get the value I need
WechatIMG149.jpeg

薛武英

unread,
Nov 23, 2022, 6:17:41 AM11/23/22
to Blockly
Drag the variable from the block, and the following error is reported

WechatIMG150.jpeg

Christopher Allen

unread,
Dec 1, 2022, 8:41:17 AM12/1/22
to blo...@googlegroups.com
Hello,

I'm sorry for the delay in answering your questions.  I've read your messages several times now and afraid that I still don't fully understand what's you are having trouble with.
 
I want to add a custom attribute to the dynamic category, such as the following icon, and then use workspace. getAllVariables () to get the value I need
WechatIMG149.jpeg

Can you explain more about what this code is doing?  It looks a bit like a block definition, but it's not in the usual format.  I gather this has to do with "add[ing] a custom attribute to the dynamic category…"—I guess groupType is the category?—but alas I am confused.

Drag the variable from the block, and the following error is reported
WechatIMG150.jpeg

It seems likely that the problem is happening at the time the block is connected, with the connection for some reason not being added to the ConnectionDB, but without seeing your code I can't really be sure or understand why.

Can you provide a minimal reproduction for this?  That is to so say: an HTML page (containing JavaScript, or including it from a .js file) and a set of instructions that we can use to produce the same error?


Sorry that we can't be of more help here.  Do please write back with more information so that we might be able to give you a better answer.

Christopher

Reply all
Reply to author
Forward
0 new messages