Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: TreeSelectionMeta

[447:14] static extends: object

Generated metadata helpers for TreeSelection class surfaces.

Methods

  • properties ()

    Returns property metadata for TreeSelection.

    • @r A list.
  • signals ()

    Returns signal metadata for TreeSelection.

    • @r A list.

class: TreeSelection

[32:7] extends: object

The selection object for GtkTreeView The GtkTreeSelection object is a helper object to manage the selection for a GtkTreeView widget. The GtkTreeSelection object is automatically created when a new GtkTreeView widget is created, and cannot exist independently of this widget. The primary reason the GtkTreeSelection objects exists is for cleanliness of code and API. That is, there is no conceptual reason all these functions could not be methods on the GtkTreeView widget instead of a separate function. The GtkTreeSelection object is gotten from a GtkTreeView by calling gtk_tree_view_get_selection(). It can be manipulated to check the selection status of the tree, as well as select and deselect individual rows. Selection is done completely view side. As a result, multiple views of the same model can have completely different selections. Additionally, you cannot change the selection of a row on the model that is not currently displayed by the view without expanding its parents first. One of the important things to remember when monitoring the selection of a view is that the GtkTreeSelection::changed signal is mostly a hint. That is, it may only emit one signal when a range of rows is selected. Additionally, it may on occasion emit a GtkTreeSelection::changed signal when nothing has happened (mostly as a result of programmers calling select_row on an already selected row).

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • TreeSelection (Handle = null)

    Creates a new TreeSelection by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • 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.
  • asObject ()

    Wraps this handle as Object.

    • @r A Object 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.
  • setOnChanged (callback Fn, UserData = null)

    Emitted whenever the selection has (possibly) changed. Please note that this signal is mostly a hint. It may only be emitted once when a range of rows are selected, and it may occasionally be emitted when nothing has happened.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TreeSelection Self).
    • @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.

  • setMode (string Value)

    Selection mode. See gtk_tree_selection_set_mode() for more information on this property.

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

    Returns the number of rows that have been selected in @tree.

  • get_mode ()

    Gets the selection mode for @selection. See gtk_tree_selection_set_mode().

  • get_tree_view ()

    Returns the tree view associated with @selection.

  • get_user_data ()

    Returns the user data for the selection function.

  • iter_is_selected (iter)

    Returns %TRUE if the row at @iter is currently selected.

    • @p iter is A valid GtkTreeIter.
  • path_is_selected (object path)

    Returns %TRUE if the row pointed to by @path is currently selected. If

    • @path does not point to a valid location, %FALSE is returned
    • @p path is A GtkTreePath to check selection on..
  • select_all ()

    Selects all the nodes. @selection must be set to %GTK_SELECTION_MULTIPLE mode.

    • @r None.
  • select_iter (iter)

    Selects the specified iterator.

    • @p iter is The GtkTreeIter to be selected..
    • @r None.
  • select_path (object path)

    Select the row at @path.

    • @p path is The GtkTreePath to be selected..
    • @r None.
  • select_range (object start_path, object end_path)

    Selects a range of nodes, determined by @start_path and @end_path inclusive. @selection must be set to %GTK_SELECTION_MULTIPLE mode.

    • @p start_path is The initial node of the range..
    • @p end_path is The final node of the range..
    • @r None.
  • set_mode (string type)

    Sets the selection mode of the @selection. If the previous type was %GTK_SELECTION_MULTIPLE, then the anchor is kept selected, if it was previously selected.

    • @p type is The selection mode.
    • @r None.
  • unselect_all ()

    Unselects all the nodes.

    • @r None.
  • unselect_iter (iter)

    Unselects the specified iterator.

    • @p iter is The GtkTreeIter to be unselected..
    • @r None.
  • unselect_path (object path)

    Unselects the row at @path.

    • @p path is The GtkTreePath to be unselected..
    • @r None.
  • unselect_range (object start_path, object end_path)

    Unselects a range of nodes, determined by @start_path and @end_path inclusive.

    • @p start_path is The initial node of the range..
    • @p end_path is The initial node of the range..
    • @r None.
  • selected_rows ()

    Returns get_selected_rows as an Aussom list of wrapper objects. This companion method materializes the full collection up front; use get_selected_rows() when lazy or change-notify access is required.

    • @r An Aussom list of elements.

class: TreeSelectionChangedCallback

[377:7] extends: object

Generated low-level callback wrapper for GIR callback changed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TreeSelectionChangedCallback (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, 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.