RGtkObject
identifies an external object as being owned by RGtk.
Practically, it allows convenience operators to be specified for any external object.
"[["(x, field, where = parent.frame())
"$"(x, member)
"=="(x, y)
RGtkObject
to which the method or field belongs or the left hand of a comparison[[.RGtkObject
and $.RGtkObject
both expand to an
RGtk function that accesses external objects. The [[
operator
looks for a field from an external C structure
by expanding objectOfClassName[[fieldName]]
to classNameGetFieldName()
.
External "methods" are expanded by the $
operator to form
classNameMethodName(objectOfClassName, ...)
from the Java-like
objectOfClassName$methodName(...)
. The long and short mechanisms give
the same result, but the shortcut is obviously more convenient. If the method
does not exist, $
will fall back to other types of members, like
properties (for GObject
s) and fields.The ==
operator compares two RGtkObject
s on the basis of their internal pointer value.
This should rarely be useful for users.