Gjsify LogoGjsify Logo

Hierarchy

  • WidgetClass

Index

Constructors

Properties

activateSignal: number

The signal to emit when a widget of this class is activated, gtk_widget_activate() handles the emission. Implementation of this signal is optional.

field

The object class structure needs to be the first element in the widget class structure in order for the class mechanism to work correctly. This allows a GtkWidgetClass pointer to be cast to a GObjectClass pointer.

field
name: string

Methods

  • adjustBaselineAllocation(widget: Gtk.Widget, baseline: number): void
  • adjustBaselineRequest(widget: Gtk.Widget, minimumBaseline: number, naturalBaseline: number): void
  • adjustSizeAllocation(widget: Gtk.Widget, orientation: Gtk.Orientation, minimumSize: number, naturalSize: number, allocatedPos: number, allocatedSize: number): void
  • adjustSizeRequest(widget: Gtk.Widget, orientation: Gtk.Orientation, minimumSize: number, naturalSize: number): void
  • Declares a callback_symbol to handle callback_name from the template XML defined for widget_type. See gtk_builder_add_callback_symbol().

    Note that this must be called from a composite widget classes class initializer after calling gtk_widget_class_set_template().

    Parameters

    • widget_class: Function | GType<unknown> | Gtk.Widget
    • callbackName: string

      The name of the callback as expected in the template XML

    • callbackSymbol: GObject.Callback

      The callback symbol

    Returns void

  • bindTemplateChildFull(widget_class: Function | GType<unknown> | Gtk.Widget, name: string, internalChild: boolean, structOffset: number): void
  • Automatically assign an object declared in the class template XML to be set to a location on a freshly built instance’s private data, or alternatively accessible via gtk_widget_get_template_child().

    The struct can point either into the public instance, then you should use G_STRUCT_OFFSET(WidgetType, member) for struct_offset, or in the private struct, then you should use G_PRIVATE_OFFSET(WidgetType, member).

    An explicit strong reference will be held automatically for the duration of your instance’s life cycle, it will be released automatically when #GObjectClass.dispose() runs on your instance and if a struct_offset that is != 0 is specified, then the automatic location in your instance public or private data will be set to %NULL. You can however access an automated child pointer the first time your classes #GObjectClass.dispose() runs, or alternatively in #GtkWidgetClass.destroy().

    If internal_child is specified, #GtkBuildableIface.get_internal_child() will be automatically implemented by the #GtkWidget class so there is no need to implement it manually.

    The wrapper macros gtk_widget_class_bind_template_child(), gtk_widget_class_bind_template_child_internal(), gtk_widget_class_bind_template_child_private() and gtk_widget_class_bind_template_child_internal_private() might be more convenient to use.

    Note that this must be called from a composite widget classes class initializer after calling gtk_widget_class_set_template().

    Parameters

    • widget_class: Function | GType<unknown> | Gtk.Widget
    • name: string

      The “id” of the child defined in the template XML

    • internalChild: boolean

      Whether the child should be accessible as an “internal-child” when this class is used in GtkBuilder XML

    • structOffset: number

      The structure offset into the composite widget’s instance public or private structure where the automated child pointer should be set, or 0 to not assign the pointer.

    Returns void

  • canActivateAccel(widget: Gtk.Widget, signalId: number): boolean
  • computeExpand(widget: Gtk.Widget, hexpandP: boolean, vexpandP: boolean): void
  • dispatchChildPropertiesChanged(widget: Gtk.Widget, nPspecs: number, pspecs: ParamSpec): void
  • Finds a style property of a widget class by name.

    Parameters

    • klass: Function | GType<unknown> | Gtk.Widget
    • propertyName: string

      the name of the style property to find

    Returns ParamSpec

  • getCssName(widget_class: Function | GType<unknown> | Gtk.Widget): string
  • Gets the name used by this class for matching in CSS code. See gtk_widget_class_set_css_name() for details.

    Parameters

    Returns string

  • getPreferredHeight(widget: Gtk.Widget): [number, number]
  • getPreferredHeightAndBaselineForWidth(widget: Gtk.Widget, width: number): [number, number, number, number]
  • getPreferredHeightForWidth(widget: Gtk.Widget, width: number): [number, number]
  • getPreferredWidth(widget: Gtk.Widget): [number, number]
  • getPreferredWidthForHeight(widget: Gtk.Widget, height: number): [number, number]
  • grabNotify(widget: Gtk.Widget, wasGrabbed: boolean): void
  • Installs a style property on a widget class. The parser for the style property is determined by the value type of pspec.

    Parameters

    Returns void

  • mnemonicActivate(widget: Gtk.Widget, groupCycling: boolean): boolean
  • queryTooltip(widget: Gtk.Widget, x: number, y: number, keyboardTooltip: boolean, tooltip: Gtk.Tooltip): boolean
  • Sets the default #AtkRole to be set on accessibles created for widgets of widget_class. Accessibles may decide to not honor this setting if their role reporting is more refined. Calls to gtk_widget_class_set_accessible_type() will reset this value.

    In cases where you want more fine-grained control over the role of accessibles created for widget_class, you should provide your own accessible type and use gtk_widget_class_set_accessible_type() instead.

    If role is #ATK_ROLE_INVALID, the default role will not be changed and the accessible’s default role will be used instead.

    This function should only be called from class init functions of widgets.

    Parameters

    • widget_class: Function | GType<unknown> | Gtk.Widget
    • role: Atk.Role

      The role to use for accessibles created for widget_class

    Returns void

  • setAccessibleType(widget_class: Function | GType<unknown> | Gtk.Widget, type: GType<unknown>): void
  • Sets the type to be used for creating accessibles for widgets of widget_class. The given type must be a subtype of the type used for accessibles of the parent class.

    This function should only be called from class init functions of widgets.

    Parameters

    • widget_class: Function | GType<unknown> | Gtk.Widget
    • type: GType<unknown>

      The object type that implements the accessible for widget_class

    Returns void

  • For use in language bindings, this will override the default #GtkBuilderConnectFunc to be used when parsing GtkBuilder XML from this class’s template data.

    Note that this must be called from a composite widget classes class initializer after calling gtk_widget_class_set_template().

    Parameters

    Returns void

  • setCssName(widget_class: Function | GType<unknown> | Gtk.Widget, name: string): void
  • Sets the name to be used for CSS matching of widgets.

    If this function is not called for a given class, the name of the parent class is used.

    Parameters

    • widget_class: Function | GType<unknown> | Gtk.Widget
    • name: string

      name to use

    Returns void

  • setTemplate(widget_class: Function | GType<unknown> | Gtk.Widget, templateBytes: any): void
  • This should be called at class initialization time to specify the GtkBuilder XML to be used to extend a widget.

    For convenience, gtk_widget_class_set_template_from_resource() is also provided.

    Note that any class that installs templates must call gtk_widget_init_template() in the widget’s instance initializer.

    Parameters

    • widget_class: Function | GType<unknown> | Gtk.Widget
    • templateBytes: any

      A #GBytes holding the #GtkBuilder XML

    Returns void

  • setTemplateFromResource(widget_class: Function | GType<unknown> | Gtk.Widget, resourceName: string): void
  • A convenience function to call gtk_widget_class_set_template().

    Note that any class that installs templates must call gtk_widget_init_template() in the widget’s instance initializer.

    Parameters

    • widget_class: Function | GType<unknown> | Gtk.Widget
    • resourceName: string

      The name of the resource to load the template from

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method