1.71 class handle

A handle object describes a possible end-point for a connection object between two graphical objects. A handle consists of two expression objects in w and h of the graphical that determine the X and Y positions of the handle.

The handle<-kind of handle determines which connections may attach to this handle. It's value should match link<-from or link<-to, depending on which end of the connection is considered.

Finally, a handle also has a name to identify it. Note that the total set of handles associated with any graphical object is the merge of graphical<-handles and class<-handles of the graphicals’class.

See also example Linking Graphicals, class connection, class link, class connect_gesture and graphical->connect.

Bugs: There are no possibilities to visualise the presence of handles.

See also
- graphical->handle
- tree-parent_handle
- graphical-handles
- class-handles
- class link
- class graphical
- class connection
- class expression

1.71.1 Instance variables

handle <-> kind: name
The connection object of a link object may attach to this handle if the link<-from or link<-to (depending on the side of the connection concerned) matches this name.
handle <-> name: name
This slot determines the logical name of the handle. It's value is used to communicate about handles.
handle <-> x_position: expression
This slot determines the position of the handle relative to the graphical. Its value is an expression expressed in w and h of the graphical object the handle belongs too. Legal expressions are:

handle <-> y_position: expression
Inherits description from: handle-x_position

1.71.2 Send methods

handle ->initialise: x=expression, y=expression, kind=[name], name=[name]
The first two arguments are expressions representing the X- and Y-coordinates expressed in the w and h variable of the area they are attached to. The first name is the handle<->kind attribute which determines the category the handle belongs to. The second name is the handle<->name attribute that determines the logical name of the handle.

Defaults: The default kind is link. The name defaults to the kind.

1.71.3 Get methods

handle <-x: relative_to=graphical, coordinate_system_of=[device] -> int
handle <-y: relative_to=graphical, coordinate_system_of=[device] -> int
handle <-position: relative_to=graphical, coordinate_system_of=[device] -> point
Compute the location of the handle relative to the indicated graphical and expressed in the coordinate system of the given device object. If no device is specified, graphical<-device is used.