Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gWidgets-handlers

change handler for ggraphics


Description

The change handler for ggraphics is called when a rubber-band selection is completed

The click handler is called on a mouse click. The handler object should pass in value for x, y

A GUI is made interactive by assigning handlers to user-generated events, such as a mouse click, change of widget state, or keyboard press. In gWidgets2 handlers are assigned through various addHandlerXXX methods. The handlers are functions whose first argument should expect a list with components obj (to pass in the receiver object) and action (to pass in any user-supplied value to the action argument). Some handlers add other components, such as mouse position information on a click, or key information on a keyboard event.

Default S3 method

The "changed" event varies wildly amongst the widgets, but is meant to be the most "obvious" one. Typically this is also similar to "selected".

Default S3 method

Add handler for clicked event

Default S3 method

Add handler for double click event

Default S3 method

This may not be supported by all toolkits.

Default S3 method

This may not be supported by all toolkits.

Default S3 method

This may not be supported by all toolkits.

Default S3 method

For table widgets (gtable, gdf) clicking the column header should trigger this event. The column that is clicked on is passed back in the component column.

Default S3 method

If defined (gtable, gdf) calls event handler for double click enent. Passes back column information through column component.

Default S3 method

Add handler for column right click event

Default S3 method

The select event defaults to the "changed" event.

Default S3 method

The "select" event is when a user "selects" an object, the "selection changed" event is when the selection changes. The distinction is in table and tree widgets where a user may select values with a single click yet want to initiate an action with a double click. The latter is the "addHandlerSelect" event, the former the "addHandlerSelectionChanged" event.

Default S3 method

When a widget has the focus, it will receive the keyboard input. This handler is called when a widget receives the focus.

Default S3 method

A blur or focus out event for a widget triggers this event handler

Default S3 method

When a widget is destroyed, a handler can be assigned to perform any clean up tasks that are needed.

Default S3 method

For gwindow objects this handler is called before the window is closed. If this handler returns TRUE the window will be closed, if FALSE the window will not be closed. In contrast, the "destroy" handler does not allow conditional destruction.

Default S3 method

Add handler for expose event (when a widget is exposed, say it had been covered)

Default S3 method

The "h" argument has components key for the key and possibly modifier for the modifier.

Default S3 method

Add handler for mousemotion events

Default S3 method

deprecated. See gtimer.

Defaults to adding a right-click mouse popup menu, better known as a context menu, though some toolkits have both this and the latter provided.

S3 method for popup menu

These menus are also known as context menus, though there isn't really a good mechanism within gWidgets2 to make the menu items context sensitive.

S3 method for popup menu

Alias for poor initial name choice

Alias for poor punctation choice

Drag and drop requires one to register widgets a sources for dragging, a widgets as a targets for dropping.

Default S3 method

The handler is called on the drop event. The component dropdata passes in the value being transferred by dragging.

Default S3 method

When a drag event crosses over the object the handler is called.

Default S3 method

Block all handlers for an object. Removed via unblockHandlers.

S3 method to block all handlers

Block a handler

S3 method to block handler

The block is a counter that gets decremented. If more blockHandlers calls are made than unblockHandlers, the handlers will still be blocked.

S3 method to block handler

method call to unblock a blocked handler

S3 method to block handler

method call to unblock a remove permanently handler

S3 method to remove handler

Usage

## Default S3 method:
addHandlerChanged(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerClicked(obj, handler, action = NULL, ...)

addHandler(obj, signal, handler, action = NULL, ...)

## Default S3 method:
addHandler(obj, signal, handler, action = NULL, ...)

addHandlerChanged(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerChanged(obj, handler, action = NULL, ...)

addHandlerClicked(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerClicked(obj, handler, action = NULL, ...)

addHandlerDoubleclick(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerDoubleclick(obj, handler, action = NULL, ...)

addHandlerRightclick(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerRightclick(obj, handler, action = NULL, ...)

addHandlerShiftclick(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerShiftclick(obj, handler, action = NULL, ...)

addHandlerControlclick(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerControlclick(obj, handler, action = NULL, ...)

addHandlerColumnclicked(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerColumnclicked(obj, handler, action = NULL, ...)

addHandlerColumnDoubleclicked(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerColumnDoubleclicked(obj, handler, action = NULL,
  ...)

addHandlerColumnRightclicked(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerColumnRightclicked(obj, handler, action = NULL,
  ...)

addHandlerSelect(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerSelect(obj, handler, action = NULL, ...)

addHandlerSelectionChanged(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerSelectionChanged(obj, handler, action = NULL, ...)

addHandlerFocus(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerFocus(obj, handler, action = NULL, ...)

addHandlerBlur(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerBlur(obj, handler, action = NULL, ...)

addHandlerDestroy(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerDestroy(obj, handler, action = NULL, ...)

addHandlerUnrealize(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerUnrealize(obj, handler, action = NULL, ...)

addHandlerExpose(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerExpose(obj, handler, action = NULL, ...)

addHandlerKeystroke(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerKeystroke(obj, handler, action = NULL, ...)

addHandlerMouseMotion(obj, handler, action = NULL, ...)

## Default S3 method:
addHandlerMouseMotion(obj, handler, action = NULL, ...)

addHandlerIdle(...)

addPopupMenu(obj, menulist, action = NULL, ...)

## Default S3 method:
addPopupMenu(obj, menulist, action = NULL, ...)

addRightclickPopupMenu(obj, menulist, action = NULL, ...)

## Default S3 method:
addRightclickPopupMenu(obj, menulist, action = NULL, ...)

## Default S3 method:
addRightclickPopupMenu(obj, menulist, action = NULL, ...)

## Default S3 method:
addRightclickPopupMenu(obj, menulist, action = NULL, ...)

addDropSource(obj, handler, action = NULL, data.type = c("text", "object"),
  ...)

## Default S3 method:
addDropSource(obj, handler, action = NULL,
  data.type = c("text", "object"), ...)

addDropTarget(obj, handler, action = NULL, ...)

## Default S3 method:
addDropTarget(obj, handler, action = NULL, ...)

addDragMotion(obj, handler, action = NULL, ...)

## Default S3 method:
addDragMotion(obj, handler, action = NULL, ...)

blockHandlers(obj, ...)

## Default S3 method:
blockHandlers(obj, ...)

blockHandler(obj, ID, ...)

## Default S3 method:
blockHandler(obj, ID, ...)

unblockHandlers(obj, ...)

## Default S3 method:
unblockHandlers(obj, ...)

unblockHandler(obj, ID, ...)

## Default S3 method:
unblockHandler(obj, ID, ...)

removeHandler(obj, ID, ...)

## Default S3 method:
removeHandler(obj, ID, ...)

Arguments

obj

object receiving event and emitting a signal to the handler

handler

handler to assign when signal is emitted. A handler is a function, its first argument should expect a list with components obj containing a reference to the object and action. Some handlers are passed additional values.

action

passed to handler to parameterize call.

...

passed along

signal

toolkit signal, e.g. "clicked"

menulist

a list of gaction items or a gmenu instance

data.type

Type of data returned. It is either text or an object

ID

returned by addHandler. If missing will try to block all handler passed to constructor

Details

Although the add_handler method, to which addHandler dispatches, is basically the workhorse to add a handler to response to a signal, it generally isn't called directly, as its use is not cross toolkit. Rather, if possible, one should use the addHandlerXXX methods to add a handler. These dispatch to this (basically) but do so in a toolkit independent manner.

This call (and the others) returns a handler ID which may be used for some toolkits later on to remove, block or unblock the call. All handlers for a widget may be blocked or unblocked via blockHandlers and unblockHandlers.

The "changed" event is also the one that a handler passed to the constructor is called on.

To specify the values that is transferred in a drag and drop event, the handler specified here should return the value to pass via drag and drop. It will appear as the dropdata component of the list passed in as the first argument of the drop handler

Value

a handler ID which can be used to block/unblock or remove the handler

Note

This method is not toolkit independent, as the signal value depends on the toolkit

For the gWidgets2Qt package one can not block, unblock or remove a single handler, but rather must do all the objects handlers at once.

See Also

blockHandlers to block all handlers for widget


gWidgets2

Rewrite of gWidgets API for Simplified GUI Construction

v1.0-8
GPL (>= 3)
Authors
John Verzani
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.