genLoadClassesCode {RGtkBindingGenerator}R Documentation

Create code to load different Gtk classes

Description

This generates C code that can be used to force the explicit creation of Gtk classes. Essentially, the C code is a sequence of calls to the associated get-type routine for each class, e.g. gtk_widget_get_type. Invoking such a routine causes the associated class to be initialized in the same way that it is implicitly created when an object of that class is created. We use this code when we want to be able to get reflectance information about a class without having to have created an instance of it.

This code is not strictly necessary on most platforms. One can explicitly call the gtk_*_get_type routine directly via the .C interface if it is accessible from the DLL/shared library. If not, this code allows one to have the same effect with an explicitly available C symbol.

Usage

genLoadClassesCode(classes, fileName)

Arguments

classes a list giving the Gtk class definitions to be loaded within this code. Only the names of the classes are used and are taken from the names attribute of this list. Alternatively, one can supply the names of the class directly.
fileName the name of the file in which to output the C code. If this is a connection object, we write to it with the usual rules of not closing an previously opened connection. This allows the caller to combine the output into an existing C file.
If the argument is not specified (i.e. missing in the call), the code is written to the standard error connection.

Value

NULL. We are only interested in the side effect. We could return the code as a string, however, one can achieve this effect by passing a textConnection as the argument for fileName.

Author(s)

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

References

http://www.omegahat.org/RGtk http://www.omegahat.org/GtkAutoBindingGen http://www.gtk.org

See Also

generateCodeFiles

Examples

 data(GtkDefs)
 genLoadClassesCode(GtkDefs$classes)

[Package RGtkBindingGenerator version 0.3 Index]