GType: The GType system

Description Usage Arguments Details Value Author(s) References See Also

Description

"The GType API is the foundation of the GObject system. It provides the facilities for registering and managing all fundamental data types, user-defined object and interface types." - GObject documentation

Usage

1
2
3
4
5

Arguments

type

The GType, either its name or numeric value, see below

name

The name of a GType

Details

The GType system supports inheritance and interfaces, enabling the psuedo-object-oriented system known as GObject. However, they also encompass all fundamental (primitive) types.

A GType is considered a transparent-type in RGtk2, since you may specify one as either the type name or the numeric value retrieved from some API function like gTypeFromName. The GType system obviously names primitive types different from the corresponding types in R, but this is automatically taken care of for you, so you can use R type names (ie, "character", "logical", etc) when specifying a GType. This means that gTypeFromName is not that useful to the RGtk2 programmer.

All R objects representing external RGtk2 objects have their hierarchy stored in the class attribute. Everything descends from "RGtkObject", then, for example, "GObject", etc. The types do not necessarily correspond to GTypes, but they do for all GObjects and others. Thus, gTypeGetAncestors is also of little use unless one is working with pure GTypes.

Value

gTypeGetAncestors returns a vector of type names from which type inherits.

gTypeGetInterfaces names the interfaces implemented by type.

gTypeFromName retrieves the numeric value of a type from its name.

gTypeGetClass returns the class instance for the type, for example GtkWidgetClass.

gTypeGetSignals returns a list of signal ids with names for the signals supported by the type.

Author(s)

Michael Lawrence

References

https://developer.gnome.org/gobject/stable/gobject-Type-Information.html

See Also

GObject


RGtk2 documentation built on Oct. 14, 2021, 5:08 p.m.

Related to GType in RGtk2...