Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GridViewActivateCallback

[494:7] extends: object

Generated low-level callback wrapper for GIR callback activate.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • GridViewActivateCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, position, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: GridViewMeta

[564:14] static extends: object

Generated metadata helpers for GridView class surfaces.

Methods

  • properties ()

    Returns property metadata for GridView.

    • @r A list.
  • signals ()

    Returns signal metadata for GridView.

    • @r A list.

class: GridView

[30:7] extends: object

Presents a large dynamic grid of items. GtkGridView uses its factory to generate one child widget for each visible item and shows them in a grid. The orientation of the grid view determines if the grid reflows vertically or horizontally. GtkGridView allows the user to select items according to the selection characteristics of the model. For models that allow multiple selected items, it is possible to turn on rubberband selection, using [property@Gtk.GridView:enable-rubberband]. To learn more about the list widget framework, see the overview. # Actions GtkGridView defines a set of built-in actions: - list.activate-item activates the item at given position by emitting the the [signal@Gtk.GridView::activate] signal. # CSS nodes gridview ├── child[.activatable] │ ├── child[.activatable] │ ┊ ╰── [rubberband] GtkGridView uses a single CSS node with name gridview. Each child uses a single CSS node with name child. If the [property@Gtk.ListItem:activatable] property is set, the corresponding row will have the .activatable style class. For rubberband selection, a subnode with name rubberband is used. # Accessibility GtkGridView uses the [enum@Gtk.AccessibleRole.grid] role, and the items use the [enum@Gtk.AccessibleRole.grid_cell] role.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GridView (model = null, factory = null)

    Creates a new GtkGridView that uses the given @factory for mapping items to widgets. The function takes ownership of the arguments, so you can write code like c grid_view = gtk_grid_view_new (create_model (), gtk_builder_list_item_factory_new_from_resource ("/resource.ui"));

    • @p model is the model to use.
    • @p factory is The factory to populate items with.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asListBase ()

    Wraps this handle as ListBase.

    • @r A ListBase object.
  • asAccessible ()

    Wraps this handle as Accessible.

    • @r A Accessible object.
  • asBuildable ()

    Wraps this handle as Buildable.

    • @r A Buildable object.
  • asConstraintTarget ()

    Wraps this handle as ConstraintTarget.

    • @r A ConstraintTarget object.
  • asOrientable ()

    Wraps this handle as Orientable.

    • @r A Orientable object.
  • asScrollable ()

    Wraps this handle as Scrollable.

    • @r A Scrollable object.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnActivate (callback Fn, UserData = null)

    Emitted when a cell has been activated by the user, usually via activating the GtkGridView|list.activate-item action. This allows for a convenient way to handle activation in a gridview. See [property@Gtk.ListItem:activatable] for details on how to use this signal.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (GridView Self, int Position).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setEnablerubberband (bool Value)

    Allow rubberband selection.

    • @p Value is the new property value.
    • @r None.
  • setFactory (object Value)

    Factory for populating list items. The factory must be for configuring [class@Gtk.ListItem] objects.

    • @p Value is the new property value.
    • @r None.
  • setMaxcolumns (int Value)

    Maximum number of columns per row. If this number is smaller than [property@Gtk.GridView:min-columns], that value is used instead.

    • @p Value is the new property value.
    • @r None.
  • setMincolumns (int Value)

    Minimum number of columns per row.

    • @p Value is the new property value.
    • @r None.
  • setModel (object Value)

    Model for the items displayed.

    • @p Value is the new property value.
    • @r None.
  • setSingleclickactivate (bool Value)

    Activate rows on single click and select them on hover.

    • @p Value is the new property value.
    • @r None.
  • setTabbehavior (string Value)

    Behavior of the Tab key

    • @p Value is the new property value.
    • @r None.
  • get_enable_rubberband ()

    Returns whether rows can be selected by dragging with the mouse.

  • get_factory ()

    Gets the factory that's currently used to populate list items.

  • get_max_columns ()

    Gets the maximum number of columns that the grid will use.

  • get_min_columns ()

    Gets the minimum number of columns that the grid will use.

  • get_model ()

    Gets the model that's currently used to read the items displayed.

  • get_single_click_activate ()

    Returns whether items will be activated on single click and selected on hover.

  • get_tab_behavior ()

    Gets the behavior set for the Tab key.

  • scroll_to (int pos, string flags, object scroll)

    Scrolls to the item at the given position and performs the actions specified in @flags. This function works no matter if the gridview is shown or focused. If it isn't, then the changes will take effect once that happens.

    • @p pos is position of the item. Must be less than the number of items in the view..
    • @p flags is actions to perform.
    • @p scroll is details of how to perform the scroll operation or %NULL to scroll into view.
    • @r None.
  • set_enable_rubberband (bool enable_rubberband)

    Sets whether selections can be changed by dragging with the mouse.

    • @p enable_rubberband is %TRUE to enable rubberband selection.
    • @r None.
  • set_factory (object factory)

    Sets the GtkListItemFactory to use for populating list items.

    • @p factory is the factory to use.
    • @r None.
  • set_max_columns (int max_columns)

    Sets the maximum number of columns to use. This number must be at least 1. If @max_columns is smaller than the minimum set via [method@Gtk.GridView.set_min_columns], that value is used instead.

    • @p max_columns is The maximum number of columns.
    • @r None.
  • set_min_columns (int min_columns)

    Sets the minimum number of columns to use. This number must be at least 1. If @min_columns is smaller than the minimum set via [method@Gtk.GridView.set_max_columns], that value is ignored.

    • @p min_columns is The minimum number of columns.
    • @r None.
  • set_model (object model)

    Sets the model to use. This must be a [iface@Gtk.SelectionModel].

    • @p model is the model to use.
    • @r None.
  • set_single_click_activate (bool single_click_activate)

    Sets whether items should be activated on single click and selected on hover.

    • @p single_click_activate is %TRUE to activate items on single click.
    • @r None.
  • set_tab_behavior (string tab_behavior)

    Sets the behavior of the Tab and Shift+Tab keys.

    • @p tab_behavior is The desired tab behavior.
    • @r None.