addMIMEObjectHandler {RGtkViewers} | R Documentation |
This allows one to register a handler function
that is responsible for processing OBJECT
nodes in an HTML
document that have the specified type
.
This function is called with the GtkHTML
widget
and the HTMLEmbedded
widgets as arguments
and it is responsible for processing
the contents of the OBJECT
,
adding any GUI component to the HTMLEmbedded
object,
and returning an S object that might be used by other
plugins within the document.
addMIMEObjectHandler(name, handler)
name |
a string giving the exact name of the MIME type as it is
used in the type attribute of an OBJECT node.
|
handler |
the S function that is to be used to process an
OBJECT node with this MIME type. This is a function that
should accept 3 arguments: the GtkHTML widget in which the
processing is occurring, the
GtkHTMLEmbedded object being processed, and
an optional 3rd argument which is the environment
in which to perform any evaluations, etc. when processing
the object. The default for this third argument should be
globalenv .
|
The updated list of MIME type handlers.
Duncan Temple Lang <duncan@research.bell-labs.com>
http://www.omegahat.org/RGtk, http://www.gtk.org
viewHtml
embeddedObjectHandler
docView
addMIMEObjectHandler("app/x-R-histogram", function(w, obj, envir = globalenv()) { w = gtkDrawingArea() asGtkDevice(w) obj$Add(w) tmp = obj$GetParameter("data") v = eval(parse(text = tmp), envir = envir) if(is.vector(v)) hist(v) dev.cur() })