# Using &kturtle;

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

The main window of &kturtle; has two main parts: the code editor (3) on the left where you type the &logo; commands, and the canvas (4) 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 three other places on the main window are: the menu bar (1) from where all the actions can be reached, the toolbar (4) that allows you to quickly select the most used actions, and the statusbar (5) where you will find feedback on the state of &kturtle;.

## The Code Editor

In the code editor you type the &logo; 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 Open Examples in the File menu and click on a file. The filename will tell you what the example is about (&eg; `square.logo` will draw a square). The file you choose will be opened in the the code editor, you can then use File Execute Commands to run the code if you like.

You can open &logo; 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 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 Execute Commands , 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.

The picture that is drawn can be saved as an image (using File Save Canvas ) or printed (using File Print... ).

## The Menubar

In the menu bar 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

#### New

&Ctrl;N File New

  Creates a new, empty &logo; file.

#### Open

&Ctrl;O File Open...

  Opens a &logo; file.

#### Open Recent

File Open Recent

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

#### Open Examples

&Ctrl;E File Open Examples

  Show the folder with examples &logo; programs. The examples should be in your favorite language that you can choose in Settings Configure &kturtle;... .

#### Execute

&Alt;Return File Execute Commands

  Starts the execution of the commands in the code editor.

#### Save

&Ctrl;S File Save

  Saves the currently opened &logo; file.

#### Save As

File Save As...

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

#### Save Canvas

File Save Canvas

  Saves the current drawing on canvas into an image.

#### Pause

Pause File Pause Execution

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

#### Stop

Escape File Stop Execution

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

#### Execution Speed

File Execution Speed

  Present a list of possible execution speeds, consisting of: Full Speed, Slow, Slower and Slowest. 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.

#### Print

&Ctrl;P File Print...

  Prints either the current code in the editor or the current drawing on the canvas.

#### Quit

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

&Ctrl;R Edit Replace...

  With this action you can replace phrases in the code.

### The View Menu

&Ctrl;&Shift;F View Full Screen Mode

  With this action you toggle the full screen mode.

  Note: When code is executed while in full screen mode everything but the canvas is hidden. This makes it possible to write full screen programs in &kturtle;.

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

&Alt;C Tools Color Picker

  This action opens the color picker. Using the color picker you can easily select a color code and insert it in the code editor.

&Ctrl;I Tools Indent

  This action indents (adds white space at the beginning of) the lines that are selected. When indentation is used properly this can make code much easier to read. All examples use indentation, please check them out.

&Ctrl;&Shift;I Tools Unindent

  This action unindents (removes the white space at the beginning of) the lines that are selected.

Tools Clean Indentation

  This action cleans indentation (removes all the white space at the beginning of) the lines that are selected.

&Ctrl;D Tools Comment

  This action add comment characters (#) in from of the lines that are selected. Lines that start with a comment character are ignored when the code is executed. Comments allow the programmer to explain a bit about his code or they can be used to temporarily prevent a certain piece of code from being executed.

&Ctrl;&Shift;D Tools Uncomment

  This action removes the comment characters from the selected lines.

### The Settings Menu

Settings Show/Hide Toolbar

  Toggle the Main Toolbar

Settings Show/Hide Statusbar

  Toggle the Statusbar

Settings Advanced Settings

  Here you can change things you normally do not need to change. The Advanced Settings submenu has three items: Configure Editor... (the standard &kate; editor settings dialog), Configure Shortcuts... (the standard &kde; shortcut settings dialog), and Configure Toolbars... (the standard &kde; toolbars setting dialog).

Settings Configure &kturtle;...

  This is used to configure &kturtle;. Here you can change the language of the &logo; commands or set a new initial canvas size.

### The Help Menu

Help &kturtle; Handbook

  This action shows the handbook that you are currently reading.

&Shift;F1 Help What's This?

  After activating this action the mouse arrow will be changed into a question mark arrow. When this arrow is used to click on parts of &kturtle; main window, a description of the particular part pops-up.

F2 Help Help on: ...

  This is a very useful function: it provides help on the code where the cursor in the code editor is at. So, &eg;, you have used the `print` command in your code, and you want to read and to know what the handbook says on this command. You just move your cursor so it is in the `print` command and you press F2. The handbook will then show all info on the `print` command.

  This function is very important while learning programming.

Help Report Bug...

  Use this to report a problem with &kturtle; to the developers. These reports can be used to make future versions of &kturtle; even better.

Help About &kturtle;

  Here you find information on &kturtle;, like the authors and the license it comes with.

Help About &kde;

  Here you can find information on &kde;. If you do not know yet what &kde; is, this is a place you should not miss.

## The Toolbar

Here you can quickly reach the most used actions. By default, you will find here all main useful commands ending with the Execute Commands and Stop Execution icons.

You can configure the toolbar using Settings Advanced Settings Configure Toolbar...

## The Statusbar

On the statusbar 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 Statusbar is indicated the current language used for the commands.