### ----------------------------------------------------
### -- Gnome::Gtk3
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gtk3/ListBox.rakumod
### ----------------------------------------------------
### -- Chunk 2 of 3
 when C<invalidate_filter()> is called.

Note that using a filter function is incompatible with using a model (see C<bind_model()>).

  method set-filter-func ( GtkListBoxFilterFunc $filter_func, Pointer $user_data, GDestroyNotify $destroy )

=item $filter_func; (closure user_data) : callback that lets you filter which rows to show
=item $user_data; user data passed to I<filter_func>
=item $destroy; destroy notifier for I<user_data>
=end pod

method set-filter-func ( GtkListBoxFilterFunc $filter_func, Pointer $user_data, GDestroyNotify $destroy ) {
  gtk_list_box_set_filter_func( self._get-native-object-no-reffing, $filter_func, $user_data, $destroy);
}

sub gtk_list_box_set_filter_func (
  N-GObject $box, GtkListBoxFilterFunc $filter_func, gpointer $user_data, GDestroyNotify $destroy
) is native(&gtk-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
#TM:0:set-header-func:
=begin pod
=head2 set-header-func

By setting a header function on the I<box> one can dynamically add headers in front of rows, depending on the contents of the row and its position in the list. For instance, one could use it to add headers in front of the first item of a new kind, in a list sorted by the kind.

The I<update_header> can look at the current header widget using C<row_get_header()> and either update the state of the widget as needed, or set a new one using C<row_set_header()>. If no header is needed, set the header to C<undefined>.

Note that you may get many calls I<update_header> to this for a particular row when e.g. changing things that don’t affect the header. In this case it is important for performance to not blindly replace an existing header with an identical one.

The I<update_header> function will be called for each row after the call, and it will continue to be called each time a row changes (via C<row_changed()>) and when the row before changes (either by C<row_changed()> on the previous row, or when the previous row becomes a different row). It is also called for all rows when C<invalidate_headers()> is called.

  method set-header-func ( GtkListBoxUpdateHeaderFunc $update_header, Pointer $user_data, GDestroyNotify $destroy )

=item $update_header; (closure user_data) : callback that lets you add row headers
=item $user_data; user data passed to I<update_header>
=item $destroy; destroy notifier for I<user_data>
=end pod

method set-header-func ( GtkListBoxUpdateHeaderFunc $update_header, Pointer $user_data, GDestroyNotify $destroy ) {
  gtk_list_box_set_header_func( self._get-native-object-no-reffing, $update_header, $user_data, $destroy);
}

sub gtk_list_box_set_header_func (
  N-GObject $box, GtkListBoxUpdateHeaderFunc $update_header, gpointer $user_data, GDestroyNotify $destroy
) is native(&gtk-lib)
  { * }
}}
#-------------------------------------------------------------------------------
#TM:0:set-placeholder:
=begin pod
=head2 set-placeholder

Sets the placeholder widget that is shown in the list when it doesn't display any visible children.

  method set-placeholder ( N-GObject() $placeholder )

=item $placeholder; a B<Gnome::Gtk3::Widget> or C<undefined>
=end pod

method set-placeholder ( N-GObject() $placeholder ) {
  gtk_list_box_set_placeholder(
    self._get-native-object-no-reffing, $placeholder
  );
}

sub gtk_list_box_set_placeholder (
  N-GObject $box, N-GObject $placeholder
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-selection-mode:
=begin pod
=head2 set-selection-mode

Sets how selection works in the listbox. See B<Gnome::Gtk3::SelectionMode> for details.

  method set-selection-mode ( GtkSelectionMode $mode )

=item $mode; The B<Gnome::Gtk3::SelectionMode>
=end pod

method set-selection-mode ( GtkSelectionMode $mode ) {
  gtk_list_box_set_selection_mode( self._get-native-object-no-reffing, $mode);
}

sub gtk_list_box_set_selection_mode (
  N-GObject $box, GEnum $mode
) is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:set-sort-func:
=begin pod
=head2 set-sort-func

By setting a sort function on the I<box> one can dynamically reorder the rows of the list, based on the contents of the rows.

The I<sort_func> will be called for each row after the call, and will continue to be called each time a row changes (via C<row_changed()>) and when C<invalidate_sort()> is called.

Note that using a sort function is incompatible with using a model (see C<bind_model()>).

  method set-sort-func ( GtkListBoxSortFunc $sort_func, Pointer $user_data, GDestroyNotify $destroy )

=item $sort_func; (closure user_data) : the sort function
=item $user_data; user data passed to I<sort_func>
=item $destroy; destroy notifier for I<user_data>
=end pod

method set-sort-func ( GtkListBoxSortFunc $sort_func, Pointer $user_data, GDestroyNotify $destroy ) {
  gtk_list_box_set_sort_func( self._get-native-object-no-reffing, $sort_func, $user_data, $destroy);
}

sub gtk_list_box_set_sort_func (
  N-GObject $box, GtkListBoxSortFunc $sort_func, gpointer $user_data, GDestroyNotify $destroy
) is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:0:unselect-all:
=begin pod
=head2 unselect-all

Unselect all children of I<box>, if the selection mode allows it.

  method unselect-all ( )

=end pod

method unselect-all ( ) {
  gtk_list_box_unselect_all(self._get-native-object-no-reffing);
}

sub gtk_list_box_unselect_all (
  N-GObject $box
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:unselect-row:
=begin pod
=head2 unselect-row

Unselects a single row of I<box>, if the selection mode allows it.

  method unselect-row ( N-GObject() $row )

=item $row; the row to unselected
=end pod

method unselect-row ( N-GObject() $row ) {
  gtk_list_box_unselect_row( self._get-native-object-no-reffing, $row);
}

sub gtk_list_box_unselect_row (
  N-GObject $box, N-GObject $row
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:_gtk_list_box_new:
#`{{
=begin pod
=head2 _gtk_list_box_new

Creates a new B<Gnome::Gtk3::ListBox> container.

Returns: a new B<Gnome::Gtk3::ListBox>

  method _gtk_list_box_new ( --> N-GObject )

=end pod
}}

sub _gtk_list_box_new (  --> N-GObject )
  is native(&gtk-lib)
  is symbol('gtk_list_box_new')
  { * }


#-------------------------------------------------------------------------------
=begin pod
=head1 Signals


=comment -----------------------------------------------------------------------
=comment #TS:0:activate:
=head2 activate

  method handler (
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object which registered the signal.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:activate-cursor-row:
=head2 activate-cursor-row

This is a keybinding signal, which will cause this row to be activated.

If you want to be notified when the user activates a row (by key or not),
use the I<row-activated> signal on the row’s parent B<Gnome::Gtk3::ListBox>.

  method handler (
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object which registered the signal.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:move-cursor:
=head2 move-cursor

  method handler (
    GEnum $arg1,
    Int $arg2,
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $arg1; a GtkMovementStep enumeration
=item $arg2; ? (no information)
=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object which registered the signal.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:row-activated:
=head2 row-activated

The I<row-activated> signal is emitted when a row has been activated by the user.

  method handler (
    N-GObject $row,
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $row; the activated row, a native B<Gnome::Gtk3::ListBoxRow>
=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object which registered the signal.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:row-selected:
=head2 row-selected

The I<row-selected> signal is emitted when a new row is selected, or
(with a C<undefined> I<row>) when the selection is cleared.

When the I<box> is using B<Gnome::Gio::TK_SELECTION_MULTIPLE>, this signal will not
give you the full picture of selection changes, and you should use
the I<selected-rows-changed> signal instead.

  method handler (
    N-GObject $row,
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $row; the selected row , a native B<Gnome::Gtk3::ListBoxRow>
=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object which registered the signal.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:select-all:
=head2 select-all

The I<select-all> signal is a keybinding signal which gets emitted to select all children of the box, if the selection mode permits it.

The default bindings for this signal is Ctrl-a.

  method handler (
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object which registered the signal.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:selected-rows-changed:
=head2 selected-rows-changed

The I<selected-rows-changed> signal is emitted when the set of selected rows changes.

  method handler (
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object which registered the signal.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:toggle-cursor-row:
=head2 toggle-cursor-row

  method handler (
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object which registered the signal.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=comment -----------------------------------------------------------------------
=comment #TS:0:unselect-all:
=head2 unselect-all

The I<unselect-all> signal is a [keybinding signal][GtkBindingSignal]
which gets emitted to unselect all children of the box, if the selection
mode permits it.

The default bindings for this signal is Ctrl-Shift-a.

  method handler (
    Int :$_handler-id,
    N-GObject :$_native-object,
    *%user-options
  )

=item $_handler-id; The handler id which is returned from the registration
=item $_native-object; The native object provided by the caller wrapped in the Raku object which registered the signal.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=end pod


#-------------------------------------------------------------------------------
=begin pod
=head1 Properties

=comment -----------------------------------------------------------------------
=comment #TP:0:activatable:
=head2 activatable

Whether this row can be activated

=item B<Gnome::GObject::Value> type of this property is G_TYPE_BOOLEAN
=item Parameter is readable and writable.
=item Default value is TRUE.


=comment -----------------------------------------------------------------------
=comment #TP:0:activate-on-single-click:
=head2 activate-on-single-click

Activate row on a single click

=item B<Gnome::GObject::Value> type of this property is G_TYPE_BOOLEAN
=item Parameter is readable and writable.
=item Default value is TRUE.


=comment -----------------------------------------------------------------------
=comment #TP:0:selectable:
=head2 selectable

Whether this row can be selected

=item B<Gnome::GObject::Value> type of this property is G_TYPE_BOOLEAN
=item Parameter is readable and writable.
=item Default value is TRUE.


=comment -----------------------------------------------------------------------
=comment #TP:0:selection-mode:
=head2 selection-mode

The selection mode

=item B<Gnome::GObject::Value> type of this property is G_TYPE_ENUM
=item The type of this G_TYPE_ENUM object is GTK_TYPE_SELECTION_MODE
=item Parameter is readable and writable.
=item Default value is GTK_SELECTION_SINGLE.

=end pod

























=finish
#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_prepend:
=begin pod
=head2 [gtk_] list_box_prepend

Prepend a widget to the list. If a sort function is set, the widget will
actually be inserted at the calculated position and this function has the
same effect of C<gtk_container_add()>.

Since: 3.10

  method gtk_list_box_prepend ( N-GObject $child )

=item N-GObject $child; the B<Gnome::Gtk3::Widget> to add

=end pod

sub gtk_list_box_prepend ( N-GObject $box, N-GObject $child )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_insert:
=begin pod
=head2 [gtk_] list_box_insert

Insert the I<child> into the I<box> at I<position>. If a sort function is
set, the widget will actually be inserted at the calculated position and
this function has the same effect of C<gtk_container_add()>.

If I<position> is -1, or larger than the total number of items in the
I<box>, then the I<child> will be appended to the end.

Since: 3.10

  method gtk_list_box_insert ( N-GObject $child, Int $position )

=item N-GObject $child; the B<Gnome::Gtk3::Widget> to add
=item Int $position; the position to insert I<child> in

=end pod

sub gtk_list_box_insert ( N-GObject $box, N-GObject $child, int32 $position )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_get_selected_row:
=begin pod
=head2 [[gtk_] list_box_] get_selected_row

Gets the selected row.

Note that the box may allow multiple selection, in which
case you should use C<gtk_list_box_selected_foreach()> to
find all selected rows.

Returns: (transfer none): the selected row as a native ListBoxRow

Since: 3.10

  method gtk_list_box_get_selected_row ( --> N-GObject  )


=end pod

sub gtk_list_box_get_selected_row ( N-GObject $box )
  returns N-GObject
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:gtk_list_box_get_row_at_index:
=begin pod
=head2 [[gtk_] list_box_] get_row_at_index

Gets the n-th child in the list (not counting headers).
If I<_index> is negative or larger than the number of items in the
list, C<Any> is returned.

Returns: a native ListBoxRow

Since: 3.10

  method gtk_list_box_get_row_at_index ( Int $index --> N-GObject  )

=item Int $index; the index of the row

=end pod

sub gtk_list_box_get_row_at_index ( N-GObject $box, int32 $index )
  returns N-GObject
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_get_row_at_y:
=begin pod
=head2 [[gtk_] list_box_] get_row_at_y

Gets the row at the I<y> position.

Returns: the row or C<Any> in case no row exists for the given y coordinate.

Since: 3.10

  method gtk_list_box_get_row_at_y ( Int $y --> N-GObject  )

=item Int $y; position

=end pod

sub gtk_list_box_get_row_at_y ( N-GObject $box, int32 $y )
  returns N-GObject
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_select_row:
=begin pod
=head2 [[gtk_] list_box_] select_row

Make I<row> the currently selected row.

Since: 3.10

  method gtk_list_box_select_row ( N-GObject $row )

=item N-GObject $row; (allow-none): The row to select or C<Any>

=end pod

sub gtk_list_box_select_row ( N-GObject $box, N-GObject $row )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_set_placeholder:
=begin pod
=head2 [[gtk_] list_box_] set_placeholder

Sets the placeholder widget that is shown in the list when
it doesn't display any visible children.

Since: 3.10

  method gtk_list_box_set_placeholder ( N-GObject $placeholder )

=item N-GObject $placeholder; (allow-none): a B<Gnome::Gtk3::Widget> or C<Any>

=end pod

sub gtk_list_box_set_placeholder ( N-GObject $box, N-GObject $placeholder )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_set_adjustment:
=begin pod
=head2 [[gtk_] list_box_] set_adjustment

Sets the adjustment (if any) that the widget uses to
for vertical scrolling. For instance, this is used
to get the page size for PageUp/Down key handling.

In the normal case when the I<box> is packed inside
a B<Gnome::Gtk3::ScrolledWindow> the adjustment from that will
be picked up automatically, so there is no need
to manually do that.

Since: 3.10

  method gtk_list_box_set_adjustment ( N-GObject $adjustment )

=item N-GObject $adjustment; (allow-none): the adjustment, or C<Any>

=end pod

sub gtk_list_box_set_adjustment ( N-GObject $box, N-GObject $adjustment )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_get_adjustment:
=begin pod
=head2 [[gtk_] list_box_] get_adjustment

Gets the adjustment (if any) that the widget uses to
for vertical scrolling.

Returns: (transfer none): the adjustment

Since: 3.10

  method gtk_list_box_get_adjustment ( --> N-GObject  )


=end pod

sub gtk_list_box_get_adjustment ( N-GObject $box )
  returns N-GObject
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:selected-foreach:
=begin pod
=head2 selected-foreach

Calls a function for each selected child. Note that the selection cannot be modified from within this function.

  method selected-foreach (
    $callback-object, Str $callback_name, *%user-options
  )

=item $callback-object; Object wherein the callback method is declared
=item $callback-name; Name of the callback method
=item %user-options; named arguments which will be provided to the callback

The callback method signature is

  method f (
    N-GObject $listbox, N-GObject $row, *%user-options
  )


=head3 Example

In the example below, the callback C<cb> has the native objects provided as C<N-GObject> coerced into B<Gnome::Gtk3::ListBox> and B<Gnome::Gtk3::ListBoxRow> using the C<()>.

  class X {
    method cb (
      Gnome::Gtk3::ListBox() $lbx, Gnome::Gtk3::ListBoxRow() $lbxr, :$test ) {
      is $lbx.widget-get-name(), 'GtkListBox', 'listbox';
      is $lbxr.widget-get-name(), 'N-GObject', 'listboxrow';
      is $test, 'abc', 'user option';
    }
  }

  $lb.selected-foreach( X.new, 'cb', :test<abc>);


=end pod
method selected-foreach (
  Any:D $func-object, Str:D $func-name, *%user-options
) {
  if $func-object.^can($func-name) {
    _gtk_list_box_selected_foreach(
      self._f('GtkListBox'),
      sub ( $n-lb, $n-lbr, $d ) {
        CATCH { default { .message.note; .backtrace.concise.note } }

# TODO; after deprecation, the call to user function must be like
# $func-object."$func-name"( $n-lb, $n-lbr, |%user-options)
#
my Method $sh = $func-object.^lookup($func-name);
my @ps = $sh.signature.params;
#note 'foreach handler: ', @ps>>.type;
my ( $arg1, $arg2);
if @ps[1].type.^name ~~ /^ 'Gnome::Gtk3::ListBox(' .*? ')' $/ {
  $arg1 = $n-lb;
}

elsif @ps[1].type.^name ~~ /^ 'Gnome::Gtk3::ListBox' $/ {
  $arg1 = Gnome::Gtk3::ListBox.new(:native-object($n-lb));
  Gnome::N::deprecate(
    'arg type Gnome::Gtk3::ListBox in callback handler',
    'Gnome::Gtk3::ListBox()',
    '0.48.6', '0.50.0'
  );
}

else {
  $arg1 = $n-lb;
}


if @ps[2].type.^name ~~ /^ 'Gnome::Gtk3::ListBoxRow(' .*? ')' $/ {
  $arg2 = $n-lbr;
}

elsif @ps[2].type.^name ~~ /^ 'Gnome::Gtk3::ListBoxRow' $/ {
  $arg2 = Gnome::Gtk3::ListBoxRow.new(:native-object($n-lbr));
  Gnome::N::deprecate(
    'arg type Gnome::Gtk3::ListBoxRow in callback handler',
    'Gnome::Gtk3::ListBoxRow()',
    '0.48.6', '0.50.0'
  );
}

else {
  $arg2 = $n-lbr;
}

        $func-object."$func-name"(
          # $n-lb, $n-lbr,
          $arg1, $arg2,
          |%user-options
        )
      },
      OpaquePointer
    );
  }

  else {
    note "Method $func-name not found in object $func-object.perl()"
      if $Gnome::N::x-debug;
  }
}

sub _gtk_list_box_selected_foreach (
  N-GObject $box,
  Callable $callback (
    N-GObject $n-listbox, N-GObject $n-listboxrow, OpaquePointer $d
  ),
  OpaquePointer $user_data
) is native(&gtk-lib)
  is symbol('gtk_list_box_selected_foreach')
  { * }


#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_get_selected_rows:
=begin pod
=head2 [[gtk_] list_box_] get_selected_rows

Creates a list of all selected children.

Returns: (element-type B<Gnome::Gtk3::ListBoxRow>) (transfer container):
A B<GList> containing the B<Gnome::Gtk3::Widget> for each selected child.
Free with C<g_list_free()> when done.

Since: 3.14

  method gtk_list_box_get_selected_rows ( --> N-GList  )


=end pod

sub gtk_list_box_get_selected_rows ( N-GObject $box )
  returns N-GList
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_unselect_row:
=begin pod
=head2 [[gtk_] list_box_] unselect_row

Unselects a single row of I<box>, if the selection mode allows it.

Since: 3.14

  method gtk_list_box_unselect_row ( N-GObject $row )

=item N-GObject $row; the row to unselected

=end pod

sub gtk_list_box_unselect_row ( N-GObject $box, N-GObject $row )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_select_all:
=begin pod
=head2 [[gtk_] list_box_] select_all

Select all children of I<box>, if the selection mode allows it.

Since: 3.14

  method gtk_list_box_select_all ( )


=end pod

sub gtk_list_box_select_all ( N-GObject $box )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_unselect_all:
=begin pod
=head2 [[gtk_] list_box_] unselect_all

Unselect all children of I<box>, if the selection mode allows it.

Since: 3.14

  method gtk_list_box_unselect_all ( )


=end pod

sub gtk_list_box_unselect_all ( N-GObject $box )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_set_selection_mode:
=begin pod
=head2 [[gtk_] list_box_] set_selection_mode

Sets how selection works in the listbox.
See B<Gnome::Gtk3::SelectionMode> for details.

Since: 3.10

  method gtk_list_box_set_selection_mode ( GtkSelectionMode $mode )

=item GtkSelectionMode $mode; The B<Gnome::Gtk3::SelectionMode>

=end pod

sub gtk_list_box_set_selection_mode ( N-GObject $box, int32 $mode )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_get_selection_mode:
=begin pod
=head2 [[gtk_] list_box_] get_selection_mode

Gets the selection mode of the listbox.

Returns: a B<Gnome::Gtk3::SelectionMode>

Since: 3.10

  method gtk_list_box_get_selection_mode ( --> GtkSelectionMode  )


=end pod

sub gtk_list_box_get_selection_mode ( N-GObject $box )
  returns int32
  is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_set_filter_func:
=begin pod
=head2 [[gtk_] list_box_] set_filter_func

By setting a filter function on the I<box> one can decide dynamically which
of the rows to show. For instance, to implement a search function on a list that
filters the original list to only show the matching rows.

The I<filter_func> will be called for each row after the call, and it will
continue to be called each time a row changes (via C<gtk_list_box_row_changed()>) or
when C<gtk_list_box_invalidate_filter()> is called.

Note that using a filter function is incompatible with using a model
(see C<gtk_list_box_bind_model()>).

Since: 3.10

  method gtk_list_box_set_filter_func ( GtkListBoxFilterFunc $filter_func, Pointer $user_data, GDestroyNotify $destroy )

=item GtkListBoxFilterFunc $filter_func; (closure user_data) (allow-none): callback that lets you filter which rows to show
=item Pointer $user_data; user data passed to I<filter_func>
=item GDestroyNotify $destroy; destroy notifier for I<user_data>

=end pod

sub gtk_list_box_set_filter_func ( N-GObject $box, GtkListBoxFilterFunc $filter_func, Pointer $user_data, GDestroyNotify $destroy )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_set_header_func:
=begin pod
=head2 [[gtk_] list_box_] set_header_func

By setting a header function on the I<box> one can dynamically add headers
in front of rows, depending on the contents of the row and its position in the list.
For instance, one could use it to add headers in front of the first item of a
new kind, in a list sorted by the kind.

The I<update_header> can look at the current header widget using C<gtk_list_box_row_get_header()>
and either update the state of the widget as needed, or set a new one using
C<gtk_list_box_row_set_header()>. If no header is needed, set the header to C<Any>.

Note that you may get many calls I<update_header> to this for a particular row when e.g.
changing things that don’t affect the header. In this case it is important for performance
to not blindly replace an existing header with an identical one.

The I<update_header> function will be called for each row after the call, and it will
continue to be called each time a row changes (via C<gtk_list_box_row_changed()>) and when
the row before changes (either by C<gtk_list_box_row_changed()> on the previous row, or when
the previous row becomes a different row). It is also called for all rows when
C<gtk_list_box_invalidate_headers()> is called.

Since: 3.10

  method gtk_list_box_set_header_func ( GtkListBoxUpdateHeaderFunc $update_header, Pointer $user_data, GDestroyNotify $destroy )

=item GtkListBoxUpdateHeaderFunc $update_header; (closure user_data) (allow-none): callback that lets you add row headers
=item Pointer $user_data; user data passed to I<update_header>
=item GDestroyNotify $destroy; destroy notifier for I<user_data>

=end pod

sub gtk_list_box_set_header_func ( N-GObject $box, GtkListBoxUpdateHeaderFunc $update_header, Pointer $user_data, GDestroyNotify $destroy )
  is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_invalidate_filter:
=begin pod
=head2 [[gtk_] list_box_] invalidate_filter

Update the filtering for all rows. Call this when result
of the filter function on the I<box> is changed due
to an external factor. For instance, this would be used
if the filter function just looked for a specific search
string and the entry with the search string has changed.

Since: 3.10

  method gtk_list_box_invalidate_filter ( )


=end pod

sub gtk_list_box_invalidate_filter ( N-GObject $box )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_invalidate_sort:
=begin pod
=head2 [[gtk_] list_box_] invalidate_sort

Update the sorting for all rows. Call this when result
of the sort function on the I<box> is changed due
to an external factor.

Since: 3.10

  method gtk_list_box_invalidate_sort ( )


=end pod

sub gtk_list_box_invalidate_sort ( N-GObject $box )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_invalidate_headers:
=begin pod
=head2 [[gtk_] list_box_] invalidate_headers

Update the separators for all rows. Call this when result
of the header function on the I<box> is changed due
to an external factor.

Since: 3.10

  method gtk_list_box_invalidate_headers ( )


=end pod

sub gtk_list_box_invalidate_headers ( N-GObject $box )
  is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_set_sort_func:
=begin pod
=head2 [[gtk_] list_box_] set_sort_func

By setting a sort function on the I<box> one can dynamically reorder the rows
of the list, based on the contents of the rows.

The I<sort_func> will be called for each row after the call, and will continue to
be called each time a row changes (via C<gtk_list_box_row_changed()>) and when
C<gtk_list_box_invalidate_sort()> is called.

Note that using a sort function is incompatible with using a model
(see C<gtk_list_box_bind_model()>).

Since: 3.10

  method gtk_list_box_set_sort_func ( GtkListBoxSortFunc $sort_func, Pointer $user_data, GDestroyNotify $destroy )

=item GtkListBoxSortFunc $sort_func; (closure user_data) (allow-none): the sort function
=item Pointer $user_data; user data passed to I<sort_func>
=item GDestroyNotify $destroy; destroy notifier for I<user_data>

=end pod

sub gtk_list_box_set_sort_func ( N-GObject $box, GtkListBoxSortFunc $sort_func, Pointer $user_data, GDestroyNotify $destroy )
  is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_set_activate_on_single_click:
=begin pod
=head2 [[gtk_] list_box_] set_activate_on_single_click

If I<single> is C<1>, rows will be activated when you click on them,
otherwise you need to double-click.

Since: 3.10

  method gtk_list_box_set_activate_on_single_click ( Int $single )

=item Int $single; a boolean

=end pod

sub gtk_list_box_set_activate_on_single_click ( N-GObject $box, int32 $single )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_get_activate_on_single_click:
=begin pod
=head2 [[gtk_] list_box_] get_activate_on_single_click

Returns whether rows activate on single clicks.

Returns: C<1> if rows are activated on single click, C<0> otherwise

Since: 3.10

  method gtk_list_box_get_activate_on_single_click ( --> Int  )


=end pod

sub gtk_list_box_get_activate_on_single_click ( N-GObject $box )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_drag_unhighlight_row:
=begin pod
=head2 [[gtk_] list_box_] drag_unhighlight_row

If a row has previously been highlighted via C<gtk_list_box_drag_highlight_row()>
it will have the highlight removed.

Since: 3.10

  method gtk_list_box_drag_unhighlight_row ( )


=end pod

sub gtk_list_box_drag_unhighlight_row ( N-GObject $box )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_list_box_drag_highlight_row:
=begin pod
=head2 [[gtk_] list_box_] drag_highlight_row

This is a helper function for implementing DnD onto a B<Gnome::Gtk3::ListBox>.
The passed in I<row> will be highlighted via C<gtk_drag_highlight()>,
and any previously highlighted row will be unhighlighted.

The row will also be unhighlighted when the widget gets
a drag leave event.

Since: 3.10

  method gtk_list_box_drag_highlight_row ( N-GObject $row )

=item N-GObject $row; a B<Gnome::Gtk3::ListBoxRow>

=end pod

sub gtk_list_box_drag_highlight_row ( N-GObject $box, N-GObject $row )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:_gtk_list_box_new:
#`{{
=begin pod
=head2 _gtk_list_box_new

Creates a new B<Gnome::Gtk3::ListBox> container.

Returns: a new B<Gnome::Gtk3::ListBox>

  method _gtk_list_box_new ( --> N-GObject )

=end pod
}}

sub _gtk_list_box_new (  --> N-GObject )
  is native(&gtk-lib)
  is symbol('gtk_list_box_new')
  {