embeddedObjectHandler      package:RGtkViewers      R Documentation

_P_r_o_c_e_s_s _O_B_J_E_C_T _t_a_g_s _i_n _H_T_M_L _v_i_e_w_e_r

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

    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. 

_D_e_t_a_i_l_s:

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

_V_a_l_u_e:

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

_A_u_t_h_o_r(_s):

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

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://www.omegahat.org/RGtk>, <URL: http://www.gtk.org>

_S_e_e _A_l_s_o:

     'viewHtml'

_E_x_a_m_p_l_e_s:

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

