All objects that can be moved around on the Graphics panel (widgets) have a common set of properties. You cannot create a WIDGET object, only objects that are also widgets.
A widget can move, it can be hidden or shown, enabled or disabled, and the size can be changed. Widgets include turtles, controls, and bitmaps.
If the command
object “WIDGET outputs
TRUE, the object has the properties listed below. If you for example, ask a
BUTTON widget if it is a button or a widget, it would always respond with
DECLARE "BUTTON "OK IS.A "OK "BUTTON Result: TRUE IS.A "OK "WIDGET Result: TRUE
This makes it easier to use the correct properties with a widget. A turtle, for example, does not have a
TEXT property like a button has, but both share the
POSITION property. This way, a Logo program can easily check if a property is OK to use with the help of the
Controls the alignment of a widget in a grid cell.
This property is only present and available if the widget is part of a Grid control; if not, the property is not present, and setting it causes a “normal” property to be created. Its value is a two element list of alignment values. For horizontal alignment, legal values are
RIGHT. For vertical alignments, legal values are
BOTTOM. Setting the property aligns the widget inside the table cell; not that for alignments to actually work, the widget must be smaller than the table cell itself. You can also use a single word like
LEFT to set just one part of the alignment.
Controls the anchoring of a widget.
This property anchors the widget relative to the borders of the Graphics panel. For horizontal alignments, validvalues are
RIGHT. For vertical alignments, valid values are
BOTTOM. Widgets often like to stay at the same position regardless of the size of the Graphics panel. If you anchor a widget at
[LEFT TOP], for example, it will stay at the same position and not move if the panel is resized. An anchor of
[RIGHT BOTTOM] would cause the widget to move with a constant distance to the right and bottom borders, so if it would be in the panel's lower right corner, it would stay there.
Note that turtles cannot be anchored; they ignore the ANCHOR property.
Controls the auto-resizing of a widget in a grid cell.
This property is only present and available if the widget is part of a Grid control; if not, the property is not present, and setting it causes a “normal” property to be created. Setting this property to
TRUE causes the widget to auto-resize to the width of the cell that contains the widget; if the cell's size grows, the widget's width grows as well.
Sets or reports the widget's border color.
Many widgets do not have a visible border by default. For these objects, their border color is returned as a fully transparent black
[0 0 0 0]. Setting this property causes a border to appear, or changes a border's color.
Note: Before, the
SIZE property used to return the actual size of the widget.
Reports the widget's size, depending on the scale and rotation.
The BOUNDS property reports the size that the widget occupies on screen after applying and scale and heading.
Sets or reports the widget's column number if in a grid cell.
This property is only present and available if the widget is part of a Grid control; if not, the property is not present, and setting it causes a “normal” property to be created. It contains the column number of the widget. Setting the property causes the widget to move to the given cell, where is removes the widget found there. The vacated cell is filled with a new
STATICTEXT control. Note that the
ARRAYBASE controls the value of the lowest possible index.
Sets or reports the widget's crawl speed.
CRAWL controls the speed at which the object moves when told to move. If set to a value less than 1, the object moves slower. The value of 0.9999 is about 200 pixels per second. The
SPEED commands work with this property.
Enables or disables a widget.
Setting the ENABLED property causes the widget to be disabled. Its appearance changes to indicate that is is no longer available for input, and it cannot be edited or clicked.
Sets or reports the widget's font.
FONT controls the font that the widget uses to draw text. This is a three-element list of the font name, its size in pixels, and a combination of attribute flags. See the
SETFONT command for details. For controls, the property controls the font that the widget uses to display text.
Determines whether the widget's drop shadow appears as a glow effect.
The GLOW property, together with the
SHADOW property, sets the widget's drop shadow to a glow effect.
Controls the widget's heading.
To lock the heading, see the
Sets or reports the object's alias name.
NAME sets or reports the alias name of the widget. Setting this property changes the object's alias name, and also sets the
TOOLTIP property. The
SETTURTLENAME commands use this property.
Controls the opacity value used for colors.
The value of OPACITY is used for colors without any opacity value. The opacity value is a value between 0 (totally transparent, so it is invisible) and 1 (totally opaque). Setting a value lower than 1 makes a drawing, other widgets beneath the widget, or the background shine through.
Controls the origin of the widget's coordinate system.
This property lets you change the home position of a widget (coordinates [0 0]). Usually, this is the center of the Graphics panel, but you can set this home position to anywhere on the Graphics panel.
Reports the widget's original name.
The original name of the widget is the name it was given when it was created. For turtles, this is the turtle number; for other widgets, this is the name used in the
DECLARE command, or the name that Logo assigned to the object during its creation. The property is read-only.
Sets or reports the widget's position.
The position is the coordinate located directly underneath the center of the widget. Setting this property causes the widget to move. The reported values are always integer values.
Sets or reports the widget's row number in a grid.
This property is only present and available if the widget is part of a Grid control; if not, the property is not present, and setting it causes a “normal” property to be created. It contains the row number of the widget. Setting the property causes the widget to move to the given cell, where is removes the widget found there. The vacated cell is filled with a new
STATICTEXT control. Note that the
ARRAYBASE controls the value of the lowest possible index.
Stores a runlist that Logo executes when the widget is clicked.
RUN contains a list of instructions that Logo runs if the widget is clicked, or a control's item was selected. This list is initially empty. Some controls, like the GRID control, ignore the RUN property. During the execution of the runlist, the global variable
:EVENTDATA contains a single-element list with the name of the clicked widget, which can be used to determine which widget was clicked.
Controls the widget's scaling.
The SCALE property controls the scalling of a widget, which is the sizing factor. A scaling factor of 2, for example, makes a widget twice as big, and a factor of 0.5 makes its size shrink by half. The property value is either a number, or a two element list for different scaling values for the width and height.
Controls the widget's drop shadow.
The SHADOW property sets the widget's drop shadow. This is a value between 0 and 999, and describes the offset in pixels of the drop shadow. The drop shadow simulates a light source towards the upper left corner of the display. A value of 3, for example, creates a neat little shadow underneath the widget.
Also, you can select a glow effect rather than a shadow by setting the widget's
GLOW property to TRUE.
Locks or unlocks a widget's rotation.
If this property is set to
TRUE, the widget does not rotate, but keeps its current rotated view when its heading changes.
Reports or sets the size of the widget's bounding box.
SIZE reports the size of the widget's bounding box in pixels, without any scaling or rotation taken into account. When setting the size of a widget, scaling and rotation are applied after the size has been set. The SIZE property reports a two-element list, which is the widget's width and height. If you use a value less that zero when setting the SIZE property, Logo picks the default value for the respective list element. If you, for example, set a button's size to [100 -1], the button will be 100 pixels wide, and its height depends on the operating system.
Note: Before, the SIZE property returned the actual size of the widget after applying scale and rotation. The property
BOUND now returns these values, and the SIZE property now takes care of the widget's size before applying scaling and rotation.
Contains the starting angle of a widget if dropped.
STARTANGLE contains the starting angle of the widget if it is dropped from the Toolbox. Some images are, for example, faced to the left; the natural starting angle of such an image is, therefore, 270 degrees.
Controls the number of pixels per step that the widget moves forward or backwards.
Controls the contents of the widget's tool tip.
The TOOLTIP property controls the text that Logo displays when the mouse cursor hovers over the widget. Initially, the tool tip is set to the widget's name.
Hides or shows the widget.
Setting this property to
FALSE hides the widget; set it to TRUE to display the widget.
Controls the sequence of widgets when displayed.
The widget's Z order determines which widget is in front of other widgets. Widgets with a higher Z order appear to be in front of turtles with a lower Z order. Each widget receives its own value when created.
Note: This property works differently from Terrapin Logo. In Terrapin Logo, a lower Z order placed the widget in front of another widget; a Z order value of 0 placed it in front. Terrapin Logo also re-computed the Z order of all widgets automatically if the Z order of a widget was changed. Logo does not do this; you can assign the same Z order value to more than one widget; the real Z order would the depend on the order of the widget's creation.
Reports the name of the Graphics panel that this widget is attached to.
WINDOW reports the name of the Graphics panel that this widget is attached to.
Currently it outputs
GRAPHICS, because there is only a single Graphics panel.
The property is read-only.
GPROP 0 "WINDOW Result: GRAPHICS