.HTMLObjectTypeHandlers {RGtkViewers}R Documentation

Functions for handling different MIME types for OBJECT nodes in HTML

Description

This is a collection of S functions that are used when processing OBJECT tags in HTML documents by viewHtml and docView. For each OBJECT node, its type attribute is extracted and matched to the names in this list of handler functions. The corresponding element for the matching name is called to process the node. These functions are used by embeddedObjectHandler.

This list can be modified and extended to add handlers for new MIME types using addMIMEObjectHandler.

This is a named list of functions. Each function should accept three arguments. The first is the GtkHTML widget in which the OBJECT node is encountered. The second argument is the GtkHTMLEmbedded object to be processed. And the third argument is optional and is the environment in which any S-language evaluations should be evaluated. The default value of this argument should be globalenv.

The initial elements are:

app/x-button
creates a button (GtkButton) using the label parameter for the text to display and the clicked parameter to provide a callback.
app/x-slider
creates GtkScale and GtkAdjustment objects to use as a scrollable slider. The parameter vertical is used to indicate whether a vertical or horizontal scale is desired. If this is missing or is FALSE, a horizontal scale is used. It retrieves the minimum, maximum and current values from the min, max and value parameters. The value-changed parameter is taken to be a callback for the slider.
app/x-R-device
create an embedded R graphics device using a GtkDrawingArea and asGtkDevice. An init parameter is evaluated and can draw into the device. This returns the device index which can be used with dev.set to make this the active device.
app/x-R-textentry
create a text entry widget (GtkEntry). A value parameter is used to provide the initial content. A size parameter is interpreted as the number of characters the entry should display.
app/x-R-label
creates a GtkLabel object by evaluating any call parameter or simply an empty label. If a parameter label is specified, this is used as the default text for the label. Alternatively, if a size parameter is specified, this is used to provide an string of this length made up of spaces to use as the text to ensure a particular width.
app/x-R-widget
create an arbitrary Widget
app/x-R-generic
a generic embedded OBJECT handler for R code that evaluates an init parameter and if the result is a GtkWidget, it adds that to the GtkHTMLEmbeded object. This can be avoided by specifying FALSE for the addWidget parameter. The the result of evaluating the init parmeter is a function, this is called with both the GtkHTML and GtkHTMLEmbedded objects as arguments and the function is responsible for performing the appropriate processing and initialization.
app/x-R-command
this is intended to evaluate S code but not create a visible embedded object. So its primary purpose is for side effects such as loading a library or dataset, initializing some variables, etc. The init tag is evaluated. This is used as the default handler, i.e. when no other name matches the given MIME type.
app/x-color
a simple example that creates a color selection widget.

Usage

data(.HTMLObjectTypeHandlers)

Format

References

http://www.omegahat.org/RGtkHTML http://www.omegahat.org/IDocs http://www.statdocs.org


[Package RGtkViewers version 0.7 Index]