how to bind an event with a block in flyout?

240 views
Skip to first unread message

方聿成

unread,
Jul 5, 2017, 11:29:05 AM7/5/17
to Blockly
I wish to bind a click event with a block in the flyout part,but I failed in finding the interface.How can I make it or maybe I can use flyout_button instead?But I don't know how to initialize one either T T.

Cory Diers

unread,
Jul 5, 2017, 4:43:34 PM7/5/17
to blo...@googlegroups.com
Could you expand a bit on the use case? If I were to guess, adding a flyout button is probably the better way to go, but hopefully I can give you better advice if I understand what you're trying to accomplish.

On Wed, Jul 5, 2017 at 8:29 AM, 方聿成 <dearp...@gmail.com> wrote:
I wish to bind a click event with a block in the flyout part,but I failed in finding the interface.How can I make it or maybe I can use flyout_button instead?But I don't know how to initialize one either T T.

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Cory Diers | Software Engineer | cory...@google.com | 

方聿成

unread,
Jul 5, 2017, 9:23:39 PM7/5/17
to Blockly

I'm trying to create a block/button just like the block with dotted line in scratch jr,it can only be clicked to show the dialog.

在 2017年7月6日星期四 UTC+8上午4:43:34,Cory Diers写道:
Could you expand a bit on the use case? If I were to guess, adding a flyout button is probably the better way to go, but hopefully I can give you better advice if I understand what you're trying to accomplish.
On Wed, Jul 5, 2017 at 8:29 AM, 方聿成 <dearp...@gmail.com> wrote:
I wish to bind a click event with a block in the flyout part,but I failed in finding the interface.How can I make it or maybe I can use flyout_button instead?But I don't know how to initialize one either T T.

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

For more options, visit https://groups.google.com/d/optout.

Cory Diers

unread,
Jul 6, 2017, 6:45:43 PM7/6/17
to blo...@googlegroups.com
Okay, adding a button to the toolbox is simple, just add it to the toolbox: https://developers.google.com/blockly/guides/configure/web/toolbox#buttons_and_labels

That will add a button, similar to the "Create variable..." button in the variables category:



That button can be stylized with css, as well, if you want to make it look more like a block (though make sure it looks like a button still, just so nobody tries to drag it onto the workspace!)

To unsubscribe from this group and stop receiving emails from it, send an email to blockly+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

方聿成

unread,
Jul 6, 2017, 9:33:12 PM7/6/17
to Blockly
Get it! Thanks a lot!!

在 2017年7月7日星期五 UTC+8上午6:45:43,Cory Diers写道:
Reply all
Reply to author
Forward
0 new messages