[[.GtkObject              package:RGtk              R Documentation

_A_c_c_e_s_s _a _v_a_l_u_e _w_i_t_h_i_n _a _G_t_k _o_b_j_e_c_t

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

     These methods allow one to treat Gtk objects in an S-like manner
     and access certain properties or values within an object by name
     or accesses the children by index. The search works first by
     looking for an accessor method for the Gtk object. If no accessor
     is found, we look for a property or Gtk `argument' within the
     object. If such a named property exists, we retrieve its value. If
     the index ('name') is a numeric value, we assume that the user
     means to access the child widget  corresponding to that index.

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

     [[.GtkObject(obj, name)
     [[.GdkEvent(obj, name)

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

     obj: the object in which the value is to be found.

    name: the name of the element to retrieve.

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

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

     An S object giving the value returned from invoking the accessor
     function or retrieving the named property or a GtkWidget  object
     which is the corresponding child of the container widget.

_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:

     Information on the package is available from <URL:
     http://www.omegahat.org/RGtk>.

     Information on Gtk is available from <URL: http://www.gtk.org>.

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

     '$.GtkObject' '.getAutoElementByName' '.getAutoMethodByName'
     'names.GtkObject'

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

      gtkInit()

      dlg <- gtkColorSelectionDialog("", show = FALSE)
       # invoke gtkColorSelectionDialogGetMainVbox()
      dlg[["MainVbox"]]

      b <- gtkButton("My own button")
       # Access a named property/argument.
      b[["label"]]

       # Create a vertical box and put the button into it.
      box <- gtkVBox(TRUE, 2)
      box$PackStart(b)
       # Now get the parent of the button, uses the named
       # property.
      b[["parent"]]

       # Get the first child, indexing by numerical value/position.
      box[[1]]
      

