class MiniGL::Component

This class is an abstract ancestor for all form components (Button, ToggleButton, TextField, DropDownList and ProgressBar).

Attributes

enabled[RW]

Determines whether the control is enabled, i.e., will process user input.

h[R]

The height of the component

params[RW]

A container for any parameters to be passed to the code blocks called in response to events of the control (click of a button, change of the text in a text field, etc.). More detail can be found in the constructor for each specific component class.

text[R]

The text of the component

visible[RW]

Determines whether the control is visible, i.e., will be drawn in the screen and process user input, if enabled.

w[R]

The width of the component

x[R]

The horizontal coordinate of the component

y[R]

The vertical coordinate of the component

Public Instance Methods

set_position(x, y) click to toggle source

Sets the position of the component. Parameters:

x

The new x coordinate.

y

The new y coordinate.

# File lib/minigl/forms.rb, line 76
def set_position(x, y)
  @x = x; @y = y
end