All panels (LISTENER, GRAPHICS, TOOLBOX, FILES, HELP, EDITOR, DEBUGGER, ICONBAR) have the same core set of properties that control their layout:
Controls the position and size of a panel.
The LAYOUT property is a four-element list of the left, top, width and height values. All values represent percentage values between 0 and 100, which refer to width and height of Logo’s container window. A width of 50, for example, would cause the panel’s width to be half of the window width.
Note that the LAYOUT property of the
ICONBAR is read-only, and reports
a list of four zeros, because its position is fixed.
GPROP “LISTENER “LAYOUT Result: [0 60 100 40]
Controls the display mode of a panel.
This property controls the display mode of a panel. It can be one of four values: NORMAL, MINIMIZED, MAXIMIZED, or HIDDEN.
Note that the
ICONBAR treats every other value than
because its position and size cannot be changed.
PPROP “EDITOR “STATE “HIDDEN
Apart from the layout properties, the Listener panel offers properties to track keyboard input and menu commands.
Reports the last key that the user has typed.
KEY reports the last key that the user has typed. The property is read-only. You can monitor keyboard input with the WHEN command.
WHEN “LISTENER [KEY = “HOME] [PR [GOING HOME]]
The Graphics panel offers the following properties in addition to the layout properties:
Controls the background color of the Graphics panel.
BGCOLOR controls the background color of the Graphics panel. Initially, this color is transparent so background images can shine through. Try to set the background color’s opacity value together with a background image!
SETBG sets this property.
PPROP “GRAPHICS “BGCOLOR [255 0 0 0.5]
Sets the background pattern.
BGPATTERN sets the background pattern using the current background color. Please see the SETBGPATTERN command for alist of possible input values.
ASK “GRAPHICS “BGPATTERN Result: 0
Reports the state of the mouse’s buttons.
BUTTON reports the state of the mouse buttons. The property is read-only. You can monitor the state of the buttons with the WHEN command.
The value of the BUTTON property is 1 for the left button down, 2 for the right button down, and 4 for the middle button down. All of these values can be combined if more than one button is pressed. If the mouse supports more than three buttons, more values like 8, 16, or 32 are possible.
WHEN “GRAPHICS [BUTTON = 1] [PR [LEFT MOUSE BUTTON CLICKED]]
Reports the position of the mouse.
Reports the position of the mouse over the Graphics panel as a two-element list of turtle coordinates. The property is read-only. You can monitor the mouse position with the WHEN command.
WHEN [MOUSE] [PR SE [MOUSE MOVED TO] MOUSE]
Controls the location of the Graphic Panel’s center point.
This property controls the offset of the entire Graphics panel from the original center point. Setting the offset’s first element to, for example, 100, moves all content of the Graphics panel 100 pixels to the right.
GPROP “GRAPHICS “OFFSET Result: [0 0]
Reports the size of the Graphics panel.
SIZE reports the size of the Graphics panel in pixels. The property is read-only. You can monitor any changes of the panel size with the WHEN command.
GPROP “GRAPHICS “SIZE Result: [1360 442]
Reports touch data on touch screen equipped devices.
TOUCH reports a list of lists when one or more fingers touch the surface of the Graphics panel. Each list element stands for a finger. Each “finger list” has three elements. The first element is a two-element list of the X and Y coordinates. The next element is again a two-element list of the touch area’s width and height; a finger is never so small that it touches only a single pixel like a mouse does. Finally, the third element indicates the amount of pressure that the finger applied; this is a value between 0 and 1. For touch screens without pressure sensitivity (most are not pressure sensitive), the value is 1.
The property is read-only. You can monitor the touch data with the WHEN command.
GPROP “GRAPHICS “SIZE Result: [1360 442]
Controls how the turtle reacts when it hits the edge of the Graphics panel.
WRAPMODE controls the turtle wrap mode; one of
See the WRAP, FENCE, WINDOW and BOUNCE commands for more details.
GPROP “GRAPHICS “WRAPMODE Result: WRAP