Gjsify LogoGjsify Logo

Hierarchy

  • WidgetClass

Index

Constructors

Properties

Methods

Constructors

Properties

activate_signal: 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
parent_class: InitiallyUnownedClass

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

  • adjust_baseline_allocation(widget: Gtk.Widget, baseline: number): void
  • adjust_baseline_request(widget: Gtk.Widget, minimum_baseline: number, natural_baseline: number): void
  • adjust_size_allocation(widget: Gtk.Widget, orientation: Gtk.Orientation, minimum_size: number, natural_size: number, allocated_pos: number, allocated_size: number): void
  • adjust_size_request(widget: Gtk.Widget, orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void
  • bind_template_callback_full(widget_class: Function | GType<unknown> | Gtk.Widget, callback_name: string, callback_symbol: GObject.Callback): 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
    • callback_name: string

      The name of the callback as expected in the template XML

    • callback_symbol: GObject.Callback

      The callback symbol

    Returns void

  • bind_template_child_full(widget_class: Function | GType<unknown> | Gtk.Widget, name: string, internal_child: boolean, struct_offset: 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

    • internal_child: boolean

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

    • struct_offset: 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

  • can_activate_accel(widget: Gtk.Widget, signal_id: number): boolean
  • compute_expand(widget: Gtk.Widget, hexpand_p: boolean, vexpand_p: boolean): void
  • dispatch_child_properties_changed(widget: Gtk.Widget, n_pspecs: number, pspecs: ParamSpec): void
  • get_css_name(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

  • get_preferred_height(widget: Gtk.Widget): [number, number]
  • get_preferred_height_and_baseline_for_width(widget: Gtk.Widget, width: number): [number, number, number, number]
  • get_preferred_height_for_width(widget: Gtk.Widget, width: number): [number, number]
  • get_preferred_width(widget: Gtk.Widget): [number, number]
  • get_preferred_width_for_height(widget: Gtk.Widget, height: number): [number, number]
  • grab_notify(widget: Gtk.Widget, was_grabbed: 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

  • mnemonic_activate(widget: Gtk.Widget, group_cycling: boolean): boolean
  • query_tooltip(widget: Gtk.Widget, x: number, y: number, keyboard_tooltip: 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

  • set_accessible_type(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

  • set_css_name(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

  • set_template(widget_class: Function | GType<unknown> | Gtk.Widget, template_bytes: Bytes): 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
    • template_bytes: Bytes

      A #GBytes holding the #GtkBuilder XML

    Returns void

  • set_template_from_resource(widget_class: Function | GType<unknown> | Gtk.Widget, resource_name: 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
    • resource_name: 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