Description Usage Arguments Details Value Note Author(s) References See Also Examples
DEPRECATED!! (compatibility wrappers for RGtk 1!)
These functions allow one to register an R expression,
call or more typically a function as a
callback for a Gtk event, and also control
the activity status of that callback.
gtkObjectAddCallback
registers the S expression, call or function
as a callback or event handler
for the specific event type
with the widget of interest.
When the event occurs for this widget,
the S "expression" will be invoked.
The block and unblock functions allow one to temporarily suspend and re-enable a callback. When suspended, any calls to the function that would normally occur are not invoked.
gtkObjectRemoveCallback
allows one to unregister a callback using
the identifier obtained when call gtkObjectAddCallback
.
gtkObjectDisconnectCallback
un-registers a callback.
1 2 3 4 5 | gtkObjectAddCallback(w, signal, f, data = NULL, object = TRUE, after = TRUE)
gtkAddCallback(w, signal, f, data = NULL, object = TRUE, after = TRUE)
gtkObjectBlockCallback(obj, id)
gtkObjectUnblockCallback(obj, id)
gtkObjectDisconnectCallback(obj, id)
|
w |
the Gtk object whose events for this signal type
are to be monitored and reported to us via a call to the function |
signal |
a string (character vector of length 1) giving the name of the signal type. See the Gtk documentation for the particular widget. |
obj |
the Gtk object for which we want to block/unblock or disconnect the callback. |
f |
the S expression, call or function which is to be invoked when an event occurs. If this is a call or expression, it is simply evaluated and no additional variables (i.e. the Gtk object for which the signal was emitted, etc.) are made available to it. If the callback is a function, it will be called with a single argument which is an external pointer to the C-level event object that describes the event. |
data |
a value that is passed to the function |
object |
a logical value indicating whether
we want the value given in the |
after |
a logical value indicating whether
to invoke this user-defined handler after the signal, or to let the
signal's default behavior preside (i.e. depending on GTK\_RUN\_FIRST
and GTK\_RUN\_LAST).
This influences which signal gets to return a value to the event
source which can be useful. If the return value is |
id |
The S function is invoked by a generic C-level event handler that makes the call to the S function. That function is stored in user-level data for the widget. The call provides one argument which is a reference to the C event instance.
gtkObjectAddCallback
returns an object of class
CallbackID
that provides a unique identifier
for the Gtk-level handler.
This is an integer value whose name attribute gives the name of the signal.
This object can be used to suspend (block), remove (disconnect)
and reactivate (unblock) a callback.
The other functions return a logical value indicating if they were succesful or else result in an error.
THIS STUFF IS VERY OLD AND DEPRECATED (compatibility wrappers for RGtk 1)
This is an extra-ordinarily early release intended to encourage others to contribute code, etc.
Duncan Temple Lang
http://www.gtk.org http://www.omegahat.net/RGtk
1 2 3 4 5 6 7 8 9 10 | if (gtkInit()) {
w <- gtkWindow(show = FALSE)
b <- gtkButton("Hit me")
w$add(b)
w$show()
gtkAddCallback(b, "clicked", function(w) {
help.start();
TRUE
})
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.