GObject                package:RGtk2                R Documentation

_T_h_e _G_O_b_j_e_c_t _s_y_s_t_e_m _i_n _R_G_t_k_2

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

     GObject is the fundamental type providing the common attributes
     and  methods for all object types in GTK+, Pango and other
     libraries based on GObject. It provides facilities for object
     construction, properties, and signals.

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

     gObjectGet(obj, ...)
     "[.GObject"(obj, value, ...)
     gObjectSet(obj, ...)
     "[<-.GObject"(obj, propNames, value)
     gObject(type, ...)
     gObjectNew(type, ...)
     gObjectSetData(obj, key, data = NULL) 
     gObjectGetData(obj, key)
     gObjectGetSignals(obj)
     gObjectGetPropInfo(obj, parents = TRUE, collapse = FALSE)
     names.GObject(x)
     interface.GObject(obj)

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

     obj: an instance of a 'GObject'

    type: the type of 'GObject' to create

     key: the unique identifier under which the data is stored

    data: the data to store with the 'GObject'

     ...: named arguments of properties to set or names of properties
          to retrieve

propNames: the names properties to set or get

   value: a value with which to set a proprety

 parents: whether to include the parents when retrieving property info

collapse: whether to collapse the properties over the parents

       x: The 'GObject' for which the property names are to be
          retrieved

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

     Every 'GObject' has a type, known as a 'GType'. Like all 
     object-oriented paradigms, types may be (in this case singly)
     inherited.  Thus, every 'GObject' has a type that descends from
     the common  'GObject' type. 'GObject's may also implement
     interfaces. The  interfaces implemented by a particular object may
     be found in the  'interfaces' attribute of an R object
     representing a 'GObject',  for which, as you might expect,
     'inherits("GObject")' returns 'TRUE'.  To conveniently access this
     attribute, use 'interface.GObject'.

     A 'GObject' is usually constructed with the constructor belonging 
     to a particular subtype (for example, 'gtkWindowNew' constructs a 
     'GtkWindow'). It is also possible to use 'gObjectNew'  to
     construct an instance of 'GObject' with the given type and
     properties.

     The properties of a 'GObject' are name-value pairs that may be
     retrieved  and set using 'gObjectGet' and 'gObjectSet',
     respectively.  Whenever specifying properties as arguments in
     RGtk2, name the arguments with  the property name and give the
     desired property value as the actual argument.  For example,
     'gObjectSet(window, modal = T)' to make a window modal. For 
     convenience, the '[' operator may be used to get/set properties.
     For example,  'window["modal"] <- T'. Properties at least partly
     describe the state of an  object and are convenient for many
     reasons, including the capability of  notification upon property
     changes. 

     This notification occurs via 'GObject' signals, which are named
     hooks for  which callbacks may be registered. The event driven
     system of GTK+ depends on  signals for coordinating objects in
     response to both user and programmatic events.  You can use
     'gSignalConnect' to connect an R function to a signal.

     Finally, arbitrary R objects can be stored in a 'GObject' under a
     specific key  for later retrieval. This can be achieved with
     'gObjectSetData' and  'gObjectGetData', respectively. This is
     similar to attributes in R, with  a major difference being that
     changes occur in the external 'GObject',  transcending the local R
     object.

     'GObject's also offer some introspection capabilities.
     'gObjectGetPropInfo'  and 'gObjectGetSignals' provide a list of
     supported properties and signals, respectively. 'names.GObject'
     lists the available properties for an object. It is hoped that in
     the future methods and fields may also be introspected.

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

     Properties and data for 'gObjectGet' and 'gObjectGetData',
     respectively.  'gObjectNew' returns a new instance of the
     specified 'type'. 'gObjectGetPropInfo' returns a named list of
     property info pertaining to a 'GObject' type,  including the types
     of the properties and their flags (read-only, read-write,
     construct, etc).  'gObjectGetSignals' gets a list of signal ids
     with names for the signals supported by the object.

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

     Michael Lawrence

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

     <URL:
     http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Ob
     ject-Type.html>

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

     'GType' 'GSignal'

