# Using &kturtle;

Here is a screenshot of &kturtle; in action
&kturtle; Main Window

The main window of &kturtle; has three main parts: the code editor (3) on the left where you type the &turtlelang; commands, the inspector (4) which gives you information about variables when the program runs, and the canvas (5) on the right where the instructions are visualized. The canvas is the turtle's playground: it is on the canvas that the turtle actually moves and draws. The four other places on the main window are: the menu bar (1) from where all the actions can be reached, the toolbar (2) that allows you to quickly select the most used actions, the Console, that you can use to enter a one line command to test it, and the statusbar (6) where you will find feedback on the state of &kturtle;.

## The Code Editor

In the code editor you type the &turtlelang; commands. It has all of the features you would expect from a modern editor. Most of its features are found in the Edit and the Tools menus. The code editor can be docked on each border of the main window or it can be detached and placed anywhere on your desktop.

You have several ways to get some code in the editor. The easiest way is to use an already-made example: choose File Examples in the File menu and select an example. The file example you choose will be opened in the the code editor, you can then use File Run to run the code if you like.

You can open &turtlelang; files by choosing File Open... .

The third way is to directly type your own code in the editor or to copy/paste some code from this user guide.

The cursor position is indicated in the statusbar, on the right with the Line number and Column number.

## The Inspector

The inspector informs you about the variables, the learned functions and the code tree while the program is running.

The inspector can be docked on each border of the main window or it can be detached and placed anywhere on your desktop.

## The Canvas

The canvas is the area where the commands are visualized, where the commands draw a picture. In other words, it is the turtle's playground. After getting some code in the the code editor, and executing it using File Run , two things can happen: either the code executes fine, and will you most likely see something change on the canvas; or you have made an error in your code and there will be a message telling you what error you made.

This message should help you to resolve the error.

You can zoom in and out the canvas with your mouse wheel.

## The Menubar

In the menubar you find all the actions of &kturtle;. They are in the following groups: File, Edit, View, Tools, Settings, and Help. This section describes them all.

### The File Menu

&Ctrl;N File New

  Creates a new, empty &turtlelang; file.

&Ctrl;O File Open...

  Opens a &turtlelang; file.

File Open Recent

  Opens a &turtlelang; file that has been opened recently.

File Examples

  Open example &turtlelang; programs. The examples are in your favorite language that you can choose in Settings Script Language .

&Ctrl;S File Save

  Saves the currently opened &turtlelang; file.

File Save As...

  Saves the currently opened &turtlelang; file on a specified location.

File Save as Picture...

  Save the current canvas as a picture.

F5 File Run

  Starts the execution of the commands in the code editor.

F6 File Pause

  Pauses the execution. This action is only enabled when the commands are actually executing.

F7 File Abort

  Stops the execution. This action is only enabled when the commands are actually executing.

File Run Speed

  Present a list of possible execution speeds, consisting of: Full Speed, Slow, Slower, Slowest and Step-by-Step. When the execution speed is set to Full Speed (default) we can barely keep up with what is happening. Sometimes this behavior is wanted, but sometimes we want to keep track of the execution. In the latter case you want to set the execution speed to Slow, Slower or Slowest. When one of the slow modes is selected the current position of the executor will be shown in the editor. Step-by-Step will execute one command at a time.

&Ctrl;P File Print...

  Prints the current code in the editor.

&Ctrl;Q File Quit

  Quits &kturtle;.

### The Edit Menu

&Ctrl;Z Edit Undo

  Undoes the last change to code. &kturtle; has unlimited undos.

&Ctrl;&Shift;Z Edit Redo

  Redoes an undone change to the code.

&Ctrl;X Edit Cut

  Cuts the selected text from the code editor to the clipboard.

&Ctrl;C Edit Copy

  Copies the selected text from the code editor to the clipboard.

&Ctrl;V Edit Paste

  Pastes the text from the clipboard to the editor.

&Ctrl;A Edit Select All

  Selects all the text from the editor.

&Ctrl;F Edit Find...

  With this action you can find phrases in the code.

F3 Edit Find Next

  Use this to find the next occurrence of the phrase.

&Shift;F3 Edit Find Previous

  Use this to find the previous occurrence of the phrase.

Ins Edit Overwrite Mode

  Toggle between the 'insert' and 'overwrite' mode.

### The View Menu

&Ctrl;E View Show Editor

  Show or hide the Code Editor.

&Ctrl;I View Show Inspector

  Show or hide the Inspector.

View Show Errors

  Show or hide the Error tab with a list of errors resulting from running the code. If this option is enabled, click on Canvas to see the turtle again.

F11 View Show Line Numbers

  With this action you can show the line numbers in the code editor. This can be handy for finding errors.

### The Tools Menu

Tools Direction Chooser...

  This action opens the direction chooser dialog.

Tools Color Picker...

  This action opens the color picker dialog.

### The Settings Menu

Settings Script Language

  Choose the language for the code.

Settings Show Toolbar

  Toggle the Main Toolbar

Settings Show Statusbar

  Toggle the Statusbar

Settings Configure Shortcuts...

  Standard &kde; dialog to configure the shortcuts.

Settings Configure Toolbars...

  Standard &kde; dialog to configure the toolbars.

### The Help Menu

&help.menu.documentation;

## The Toolbar

Here you can quickly reach the most used actions. By default, you will find here all main useful commands ending with the Run, Pause and Abort icons. The last item at the end of the toolbar is the Console, that you can use to enter a one line command and test it.

You can configure the toolbar using Settings Configure Toolbars...

## The Statusbar

On the status bar you get feedback of the state of &kturtle;. On the left side it shows the feedback on the last action. On the right side you find the current location of the cursor (line and column numbers). In the middle of the status bar is indicated the current language used for the commands.