genLoadClassesCode {RGtkBindingGenerator} | R Documentation |
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.
genLoadClassesCode(classes, fileName)
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. |
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
.
Duncan Temple Lang <duncan@research.bell-labs.com>
http://www.omegahat.org/RGtk http://www.omegahat.org/GtkAutoBindingGen http://www.gtk.org
data(GtkDefs) genLoadClassesCode(GtkDefs$classes)