dollar.GtkObject {RGtk}R Documentation

Find methods for an S-Gtk object

Description

These accessor functions find the appropriate method for a Gtk object based on its class hierarchy information. This allows one to invoke a method such as show on a Gtk object without having to remember for which parent class it was defined (e.g. GtkWidget). So w$Show will find the method. The function exploits the naming convention used in Gtk and the R-Gtk interface to find S functions of the form gtk<Type>FunctionName, and it searches for the most appropriate function given the object's class.

Usage

obj$name
"$.GtkObject"(obj, name)
"$.GtkType"(obj, name)
"$.GdkEvent"(obj, name)

Arguments

obj the GtkObject whose classes are to be used to find the method of interest.
name the shortened name of the method of interest. This is combined with the appropriate class of Gtk object to produce the full name.

Details

This searches for an appropriate S function by combining the name of the function with each of the elements in the class vector of obj. This can be expensive. A more classical OOP mechanism would be more efficient and will likely be implemented in the future.

Value

The return value is a function which has access to the obj value so that it can call the real S function with that object as the first argument. One typically invokes the function directly, as in w$Show() and it is not intended that one assigns the result of the $ operation for later use.

Note

In the future, the RGtk interface may use a more traditional object oriented class mechanism provided by the http://www.omegahat.org/OOP in which case the dispatching will be done internally from the definitions of the Gtk class rather than using this ``home-made'' mechanism.

Author(s)

Duncan Temple Lang <duncan@research.bell-labs.com>

References

Information on the package is available from http://www.omegahat.org/RGtk.

Information on Gtk is available from http://www.gtk.org.

See Also

[[.GtkObject .getAutoMethodByName .getAutoElementByName

Examples

 gtkInit()

 w <- gtkButton("My button", show = FALSE)
 w$Show()
 w$Hide()
 w$Destroy()

[Package RGtk version 0.7-0 Index]