[[.GtkObject {RGtk}R Documentation

Access a value within a Gtk object

Description

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.

Usage

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

Arguments

obj the object in which the value is to be found.
name the name of the element to retrieve.

Details

Value

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.

Author(s)

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

References

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

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

See Also

$.GtkObject .getAutoElementByName .getAutoMethodByName names.GtkObject

Examples

 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]]
 

[Package RGtk version 0.7-0 Index]