Dodawanie listy narzędzi
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
W skrzynce narzędzi znajdują się bloki, których używasz do programowania. Bloki można przeciągać na obszar roboczy.
Więcej informacji o tym, jak wygląda panel narzędzi, znajdziesz w wizualnym glosariuszu.
Podstawowa definicja
Definicja zestawu narzędzi określa, które bloki są w nim uwzględnione i w jakiej kolejności. Większość wyglądu i stylu skrzynki narzędzi jest określana w inny sposób.
Zalecamy zdefiniowanie zestawu narzędzi za pomocą kodu JSON.
Ten fragment kodu definiuje wyskakujące okienko z 2 blokami:
const toolbox = {
// There are two kinds of toolboxes. The simpler one is a flyout toolbox.
kind: 'flyoutToolbox',
// The contents is the blocks and other items that exist in your toolbox.
contents: [
{
kind: 'block',
type: 'controls_if'
},
{
kind: 'block',
type: 'controls_whileUntil'
}
// You can add more blocks to this array.
]
};
// The toolbox gets passed to the configuration options during injection.
const workspace = Blockly.inject('blocklyDiv', {toolbox: toolbox});

Więcej informacji o definiowaniu i konfigurowaniu zestawu narzędzi znajdziesz w artykule Omówienie zestawu narzędzi.
Więcej informacji o wstrzykiwaniu znajdziesz w artykule Tworzenie Google Workspace.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-06-13 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-06-13 UTC."],[[["The Blockly toolbox houses programming blocks that users can drag onto the workspace to build programs."],["Toolboxes are typically defined using JSON to specify which blocks are included and their arrangement."],["The provided code snippet demonstrates creating a basic flyout toolbox containing 'controls_if' and 'controls_whileUntil' blocks."],["Further information regarding toolbox configuration and workspace injection can be found in the linked resources."]]],["The toolbox, containing program blocks, is defined using JSON and can be dragged onto the workspace. A flyout toolbox, a simpler type, is specified by its `kind` and `contents`. The `contents` array lists blocks, defined by their `kind` and `type`, such as `controls_if` and `controls_whileUntil`. This toolbox definition is then passed to the configuration during the workspace injection process using `Blockly.inject`.\n"]]