embeddedObjectHandler {RGtkViewers} | R Documentation |
This is a callback or signal handler
that can be used for processing <OBJECT>
tags in HTML when rendering a document
with the GtkHTML
widget.
When the HTML parser encounters each <OBJECT> tag,
it calls the object_requested
callback.
This callback is expected to process the <OBJECT>
instruction. It can create widgets or perform other operations
that have desired side-effects.
This function is an extensible mechanism for handling
different MIME types that are encountered in the
<OBJECT>
tag.
One can add handler functions for particular MIME types
by adding them to the .HTMLObjectTypeHandlers
list, using the name of the MIME type as the index.
embeddedObjectHandler(html, obj, envir = globalenv(), asIs = FALSE)
html |
the GtkHTML widget in which the
<OBJECT> is to be rendered |
obj |
information from
the <OBJECT> tag
that describes what is being requested.
This is an object
of class gtkHTMLEmbedded
and it has information about the
type of object to be created,
the parameters/attributes in the <OBJECT> ,
etc.
One can access these via the properties
(using the [[ operator or gtkObjectGetArgs )
and the
gtkHTMLEmbedded methods (e.g. gtkHTMLEmbeddedGetParameter ).
|
envir |
the environment in which to evaluate the code associated
with the OBJECT description. This is passed to the
MIME handler functions so that they can create the correct
environments for functions defined within the processing of the
OBJECT, find other variables, etc. |
asIs |
if TRUE return the value directly from
the MIME handler function. This is useful if this function is being
called by a wrapper handler. Otherwise if it is being called
directly by the HTML widget, it should return a logical value.
|
This function is registered with a gtkHTML
object and is invoked when each time
the renderer processes a <OBJECT>
tag.
This function attempts to create a suitable object. If it is a widget, the function inserts it into the
Duncan Temple Lang <duncan@research.bell-labs.com>
http://www.omegahat.org/RGtk, http://www.gtk.org
viewHtml(system.file("examples", "form.html", package="RGtkViewers")) # load an R library given a node of the form # <OBJECT type="app/x-R-library" name="mva" /> .HTMLObjectTypeHandlers[["app/x-R-library"]] = function(html, obj) { library(obj[["name"]]) }