embeddedObjectHandler {RGtkViewers}R Documentation

Process OBJECT tags in HTML viewer

Description

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.

Usage

embeddedObjectHandler(html, obj, envir = globalenv(), asIs = FALSE)

Arguments

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.

Details

This function is registered with a gtkHTML object and is invoked when each time the renderer processes a <OBJECT> tag.

Value

This function attempts to create a suitable object. If it is a widget, the function inserts it into the

Author(s)

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

References

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

See Also

viewHtml

Examples

 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"]])
  }

[Package RGtkViewers version 0.7 Index]