KookaBlockly Conventions

KookaBlockly provides an extensive palette of blocks to assemble into scripts. The blocks palette is on the left of the display organised into functionally related categories.

Clicking on a category, for example the Control category, reveals the blocks available within that category. To use the block, click on it and drag it onto the KookaBlockly workspace and release, and/or drag it into position until it snaps onto an adjacent block. Any block in the workspace can be clicked on and dragged into position.

The blocks palette will close automatically when a block is dragged into the workspace. Otherwise, the palette can be closed by clicking on the same block palette symbol that was used to open the palette, or by pressing the Esc key on the keyboard.

Block Shapes

KookaBlockly contains three basic block shapes:

  1. A C-shaped block directs program flow and contains a sequence of action blocks. The C-shaped block may be a loop, or may be a sequence of blocks that are run conditionally subject to one or more logical tests.

Every Loop If-Do Flow Blocks
  1. An action or “do” block which performs an operation. The block has an indent in the top border and a matching protrusion on the bottom border. These blocks click together like jigsaw pieces and may be placed in a vertical column and within a C-shaped block.

Display Clear Action Block
  1. A value block which has a jigsaw tab on the left-hand edge. These blocks evaluate an expression and assign an output value to the blocks to which they are connected. Some value blocks have a matching receptacle on the right-hand edge which accepts other value blocks.

Number Value Block

Block Configuration

Some blocks have configuration options denoted by a cog symbol. Clicking on the cog symbol presents options that may be used to configure the block.

Block Configuration

Right-clicking

Right-clicking on a block also presents a set of option as below. These include: duplicate the current block; add a comment; collapse the block into a compact presentation or expand a collapsed block; disable or enable a block; remove the block from the program; or display some Help text about the block (if the Help text has been provided).

Block Right-Click Options
Duplicate

Click on Duplicate to create a duplicate of the block and any connected sub-blocks in the workspace.

Sub-blocks for example are all the blocks nested within a control block, or any value blocks connected to an action block.

Add Comment

Click on Add Comment and a circle with a question mark will appear in the block.

Click on the question mark and an area pane is provided for a user to enter in a comment.

This comment will be included in the MicroPython script generated by KookaBlockly.

Comments are very useful for describing parts or portions of the script for later reference by subsequent users of the script.

Collapse Block

Click on Collapse Block to truncate the block.

This is useful when a large number of blocks are in the workspace and the user wants to make a block smaller so that it is easier to see other blocks.

The user can restore the collapsed block at any time.

Disable Block

Click on Disable Block to make the block turn white and it will not be included in the script.

This is similar to “commenting out” lines of scripts when writing MicroPython code.

Delete Block

Choose a block by clicking on it.

Right click on the block and then choose Delete Block to delete the block from the script or press the Delete key on the keyboard.

Blocks can also be deleted by clicking on a block, separating it from the graphical script and dragging it into the Trash.

Clicking on the Trash icon, which is at the bottom-right of the Workspace, opens the lid and displays the deleted items.

Any deleted item may be dragged back into the workspace to become part of the program.

Clicking on a blank area of the workspace closes the Trash.

Text Delimiters

Many blocks contain text fields. In KookaBlockly, text is enclosed by double-quotes ", and these are automatically applied.

However there are some exceptions, particularly in the Advanced block which permits any valid MicroPython statement to be entered. Here it is important to use the double-quotes " and not single quotes ' to delimit text, as single-quotes are used in KookaBlockly’s XML block code and will be misinterpreted rendering the saved KookaBlockly file unusable (without manually correcting the XML block code).

Deleting Blocks

Any block in the workspace, including any attached input blocks, can be removed from the script by:

  1. dragging the block to the Trash at the bottom-right of the workspace. The Trash icon will show an open lid when the dragged block is correctly positioned.

  2. or by clicking on the block to highlight it (shows a yellow outline), then pressing the delete key (or backspace key on Windows).

Blocks removed can be retrieved from the Trash by clicking on the Trash icon. A grey box will appear containing all of the deleted blocks. To retrieve a block, drag it back into the workspace. The Trash will then close automatically.

To close the Trash without dragging a block into the workspace, press on the Esc key.