Questions tagged [blockly]

Blockly is an open-source web-based, graphical programming environment that enables users to write JavaScript, Python, PHP, and Dart programs by moving around blocks. Developers can extend it to integrate with their own apps. It has been translated into over 40 (human) languages.

197 questions
0
votes
1 answer

Creating a custom block and writing the code to generate the Javascript code on Android

I want a different category of blocks called 'Movement' with two blocks inside it called MoveForward and MoveBackward. In the toolbox.xml file in blockly core library, I added the XML code for creating the UI.
Gissipi_453
  • 1,250
  • 1
  • 25
  • 61
0
votes
0 answers

Need to run the code generated by blockly on Android

I have integrated Blockly on Android. Using the block editor, I can make a code block. On running it, it gives JavaScript code as output. I'm running the code generated by blockly on the Android app itself in a WebView and getting an output which I…
Gissipi_453
  • 1,250
  • 1
  • 25
  • 61
0
votes
1 answer

Javascript to dom - Blockly

I am building a simple editor using Blockly. User can save generated javascript to server and can download as 'txt' file. User can also import the notepad file to editor (notepad file contains generated javascript). How to build blocks from the…
Basavaraj Metri
  • 836
  • 1
  • 14
  • 27
0
votes
1 answer

Blockly : Equivalent of pause in time ? ( In JS it is setTimout )

What if I wish to pause for a few seconds in Blockly ? How to do this with the Blockly blocks ? (The equivalent in Javascript is setTimeout.)
Mira
  • 1
0
votes
1 answer

Can't Add FieldVariable in Blockly

I'm trying to put a foreach loop into my web blockly interface but am getting weird error messages. When the block tries to load it shows a TypeError (TypeError: Blockly.Msg.DELETE_VARIABLE is undefined[Learn More]). This error goes away when I take…
0
votes
0 answers

Include a local JS client library in React

I am trying to use google blockly in a react application. Based on the examples I have seen I need to include a JS library on the page using a script tag. I cannot seem to figure out how to do this in react even though it should be simple. I could…
Tanner Ewing
  • 337
  • 4
  • 18
0
votes
1 answer

creating blockly block connections to blocks in code

I have implemented a context menu handler that adds a block to the workspace. I am trying to add the block in between the block that summoned the context menu and any blocks that may already be connected to it ( previousConnection ). What I'm…
objectthink
  • 21
  • 1
  • 3
0
votes
1 answer

Dynamically load javascript with global var

My project requires to : set values to global variable then load external JavaScript which uses this global variable then change variable and load again same javascript while the external javascript looks as (using Google…
Wenza
  • 37
  • 8
0
votes
0 answers

How to stop an infinite loop from a class executed by a thread in python?

I have some python codes in string format (output of Blockly) that I use for to instance a custom class. Then they are executed concurrently in threads. This is a simplistic example of the code: import threading from time import sleep class…
JaviCru
  • 51
  • 1
  • 9
0
votes
1 answer

how to get value from a statement block of blockly in array?

I am working with Blockly , and I am quite new to that. I am having a statement block there under which I am able to add some other blocks. My problem is when I am trying to convert the statement block using Blockly.JavaScript.statementToCode(block,…
Novice
  • 401
  • 7
  • 27
-1
votes
1 answer

How can we create a treeview toolbox in blockly as in image any sample code or need guide to the docs

In the image left is toolbox,when we select the option in tool box it opens a flyout in workspace as in the right can't understand the procedure in docs need help to integrate it using html javascript
-1
votes
1 answer

Functions - different meanings in different languages?

I am a very novice programmer, taking a course on the fundamentals of Java. In Alice 3, a function is defined as: A Function computes and answers a question about an object, such as, “What is its width or height?" I have used Blockly before and in…
-2
votes
1 answer

Need to use blockly to answer, I will attach the link to the website. Can not use "if" block and equations. Need to use loop. Thank you in advance

Design a program to find the total of all integers from 1 to a number specified by the user. The program should ask the user for the number, and then calculate and display the total from 1 to that number. The output message format is ‘The total from…
Kwan
  • 1
-2
votes
1 answer

Is it possibly to re-load a JS script file dynamically?

We're looking at using Blockly to enable power-users to design business rules in a non-coding, sandboxed way. When they edit their diagram to regenerate new JS code, I would like to reload this into the browser. One aspect of this is, if the code is…
Mr. Boy
  • 60,845
  • 93
  • 320
  • 589
-3
votes
2 answers

How to simplify this Blockly program drawing a snowflake?

The question says that: The program shown below on the left draws a snowflake. It uses 33 code blocks. Can you re-write it so that it uses at least one function and less than 30 blocks. How can I draw this using Blockly?
1 2 3
13
14