Skip to content

API Reference / @gtkx/runtime / peekTypeClass

Function: peekTypeClass()

peekTypeClass(type, base?): object

Defined in: packages/runtime/dist/registry.d.ts:139

Returns a GObject type's class struct, wrapped in the class-struct wrapper classes registered for the type's ancestry, such as Gtk.WidgetClass composed with GObject.ObjectClass for a widget type. The class is referenced so it exists even before the type's first instance, and the reference is deliberately never released: once created, a class struct lives for the rest of the process. Backs the peek statics of generated GTypeStruct wrappers, such as GObject.ObjectClass.peek and Gtk.WidgetClass.peek.

Parameters

type

bigint | AnyClass

GType to peek the class struct of, or a registered wrapper class of the type.

base?

AnyClass

When given, wrapper class of the type the peeked type must derive from; the peek throws for a type outside that lineage. Without it any GObject type is accepted.

Returns

object

The wrapped class struct.

Released under the MPL-2.0 License.