<<<<<<<<<<<<<<<<<

ui_mouse(ui) HP Widgets ui_mouse(ui)

NAME

ui_mouse - manipulate mouse in an X environment

DESCRIPTION

The ui_mouse class provides a script-level interface to the X mouse. A script programmer can set input masks and desired event types, and retrieve the mouse soordinates.

SUPERCLASS

ui

INSTANCE VARIABLES

active_object is unused.

initializer holds the name of an actions object to be executed the first time a ui_mouse instance is accessed.

nobuttons holds the name of an actions object to be executed when the mouse is sent a tick! message and no mouse buttons are pressed.

button1 holds the name of an actions object to be executed when the mouse is sent a tick! message and button1 is pressed.

button2 holds the name of an actions object to be executed when the mouse is sent a tick! message and button2 is pressed.

button3 holds the name of an actions object to be executed when the mouse is sent a tick! message and button3 is pressed.

button1_shift holds the name of an actions object to be executed when the mouse is sent a tick! message and button1 and the shift key are pressed.

button2_shift holds the name of an actions object to be executed when the mouse is sent a tick! message and button2 and the shift key are pressed.

button3_shift holds the name of an actions object to be executed when the mouse is sent a tick! message and button3 and the shift key are pressed.

button1_control holds the name of an actions object to be executed when the mouse is sent a tick! message and button1 and the control key are pressed.

button2_control holds the name of an actions object to be executed when the mouse is sent a tick! message and button2 and the control key are pressed.

button3_control holds the name of an actions object to be executed when the mouse is sent a tick! message and button3 and the control key are pressed.

events holds the name of a vector object that contains the values of the events you are interested in.

x_start holds the name of a scalar object that is set to the mouse's x position when a ButtonPress occurs. This variable cannot be set by the user.

y_start holds the name of a scalar object that is set to the mouse's y position when a ButtonPress occurs. This variable cannot be set by the user.

x_end holds the name of a scalar object that is set to the mouse's x position when any interesting mouse event occurs. This variable cannot be set by the user.

y_start holds the name of a scalar object that is set to the mouse's y position when any interesting mouse event occurs. This variable cannot be set by the user.

window_width is unused.

window_height is unused.

state is set to the state field of the last X event. This is only set for MotionNotify, ButtonPress, ButtonRelease, KeyPress, KeyRelease, EnterNotify, and LeaveNotify events (those X event states for which mouse button state is known). This variable cannot be set by the user.

button is unused.

mouse_event is set to the last X event processed.

window is for internal use only. This variable cannot be set or retrieved by the user.

MESSAGES

mouse_event? returns the last event sent to the ui_mouse instance.

state? returns the ui_mouse instance state.

initializer?, nobuttons?, button1?, button2?, button3?, button1_shift?, button2_shift?, button3_shift?, button1_control?, button2_control?, and button3_control? return the repective actions object of the instance.

events? returns the name of the events instance variable.

events= sets the events instance variable.

x_start? returns the name of the scalar object that holds the mouse x position at the last time a mouse button was pressed. You should be sure that a ButtonPress event has occurred before querying that scalar object. (See the mouse_event? message.)

y_start? returns the mouse y position at the last time a mouse button was pressed. You should be sure that a ButtonPress event has occurred before querying that scalar object. (See the mouse_event? message.)

x_end? returns the mouse x position at the last time an event was processed by the ui_mouse object. See the mouse_event? message.

y_end? returns the mouse y position at the last time an event was processed by the ui_mouse object. See the mouse_event? message.

tick! causes the ui_mouse's tick actions to be executed. Normally sent internally, not by the user's script.

event: executes the initializer actions the first time, then events are compared to the events instance variable and cause tick! messages to be sent to the instance if a match is found. Normally sent internally, not by the user's script.

EXAMPLES

/* create a ui_mouse object, and make it sensitive to ButtonPress and

MotionNotify events */

<xinit -- defines X event and event mask scalars

scalar new: x1; -- x,y on ButtonPress scalar new: y1; scalar new: x2; -- x,y on other interesting events scalar new: y2;

vector new: my_events dimension= 2 = ( ButtonPress, MotionNotify ) ;

ui_mouse new: mouse -- input_mask must be set in the parent object. See ui man page. events= my_events

button1= b1_action -- a set of actions to execute when an interesting -- event occurs and button1 is pressed x_start= "x1" y_start= "y1" x_end= "x2" y_end= "y2" ;

SEE ALSO

ui


Please send comments and suggestions to
consult@rpi.edu