### ----------------------------------------------------
### -- Gnome::Gtk3
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gtk3/TextView.rakumod
### ----------------------------------------------------
### -- Chunk 2 of 5
 run.

Returns: C<1> if I<iter> moved and is not on the end iterator

  method gtk_text_view_move_visually ( N-GObject $iter, Int $count --> Int  )

=item N-GObject $iter; a B<Gnome::Gtk3::TextIter>
=item Int $count; number of characters to move (negative moves left,  positive moves right)

=end pod

sub gtk_text_view_move_visually ( N-GObject $text_view, N-GObject $iter, int32 $count )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_im_context_filter_keypress:
=begin pod
=head2 [[gtk_] text_view_] im_context_filter_keypress

Allow the B<Gnome::Gtk3::TextView> input method to internally handle key press
and release events. If this function returns C<1>, then no further
processing should be done for this key event. See
C<gtk_im_context_filter_keypress()>.

Note that you are expected to call this function from your handler
when overriding key event handling. This is needed in the case when
you need to insert your own key handling between the input method
and the default key event handling of the B<Gnome::Gtk3::TextView>.

|[<!-- language="C" -->
static gboolean
gtk_foo_bar_key_press_event (B<Gnome::Gtk3::Widget>   *widget,
B<Gnome::Gdk3::EventKey> *event)
{
if ((key->keyval == GDK_KEY_Return || key->keyval == GDK_KEY_KP_Enter))
{
if (gtk_text_view_im_context_filter_keypress (GTK_TEXT_VIEW (view), event))
return TRUE;
}

// Do some stuff

return GTK_WIDGET_CLASS (gtk_foo_bar_parent_class)->key_press_event (widget, event);
}
]|

Returns: C<1> if the input method handled the key event.

Since: 2.22

  method gtk_text_view_im_context_filter_keypress ( N-GdkEventKey $event --> Int  )

=item N-GdkEventKey $event; the key event

=end pod

sub gtk_text_view_im_context_filter_keypress ( N-GObject $text_view, N-GdkEventKey $event )
  returns int32
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_reset_im_context:
=begin pod
=head2 [[gtk_] text_view_] reset_im_context

Reset the input method context of the text view if needed.

This can be necessary in the case where modifying the buffer
would confuse on-going input method behavior.

Since: 2.22

  method gtk_text_view_reset_im_context ( )


=end pod

sub gtk_text_view_reset_im_context ( N-GObject $text_view )
  is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_add_child_at_anchor:
=begin pod
=head2 [[gtk_] text_view_] add_child_at_anchor

Adds a child widget in the text buffer, at the given I<anchor>.

  method gtk_text_view_add_child_at_anchor ( N-GObject $child, GtkTextChildAnchor $anchor )

=item N-GObject $child; a B<Gnome::Gtk3::Widget>
=item GtkTextChildAnchor $anchor; a B<Gnome::Gtk3::TextChildAnchor> in the B<Gnome::Gtk3::TextBuffer> for I<text_view>

=end pod

sub gtk_text_view_add_child_at_anchor ( N-GObject $text_view, N-GObject $child, GtkTextChildAnchor $anchor )
  is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_add_child_in_window:
=begin pod
=head2 [[gtk_] text_view_] add_child_in_window

Adds a child at fixed coordinates in one of the text widget's windows.

The window must have nonzero size (see C<gtk_text_view_set_border_window_size()>). Note that the child coordinates are given relative to scrolling. When placing a child in C<GTK_TEXT_WINDOW_WIDGET>, scrolling is irrelevant, the child floats above all scrollable areas. But when placing a child in one of the scrollable windows (border windows or text window) it will move with the scrolling as needed.

  method gtk_text_view_add_child_in_window (
    N-GObject $child, GtkTextWindowType $which_window, Int $xpos, Int $ypos
  )

=item N-GObject $child; a B<Gnome::Gtk3::Widget>
=item GtkTextWindowType $which_window; which window the child should appear in
=item Int $xpos; X position of child in window coordinates
=item Int $ypos; Y position of child in window coordinates

=end pod

sub gtk_text_view_add_child_in_window ( N-GObject $text_view, N-GObject $child, int32 $which_window, int32 $xpos, int32 $ypos )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_move_child:
=begin pod
=head2 [[gtk_] text_view_] move_child

Updates the position of a child, as for C<gtk_text_view_add_child_in_window()>.

  method gtk_text_view_move_child ( N-GObject $child,  Int $xpos, Int $ypos )

=item N-GObject $child; child widget already added to the text view
=item Int $xpos; new X position in window coordinates
=item Int $ypos; new Y position in window coordinates

=end pod

sub gtk_text_view_move_child ( N-GObject $text_view, N-GObject $child,  int32 $xpos, int32 $ypos )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_wrap_mode:
=begin pod
=head2 [[gtk_] text_view_] set_wrap_mode

Sets the line wrapping for the view.

  method gtk_text_view_set_wrap_mode ( GtkWrapMode $wrap_mode )

=item GtkWrapMode $wrap_mode; a B<Gnome::Gtk3::WrapMode>

=end pod

sub gtk_text_view_set_wrap_mode ( N-GObject $text_view, int32 $wrap_mode )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_wrap_mode:
=begin pod
=head2 [[gtk_] text_view_] get_wrap_mode

Gets the line wrapping for the view.

Returns: the line wrap setting

  method gtk_text_view_get_wrap_mode ( --> GtkWrapMode  )


=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_editable:
=begin pod
=head2 [[gtk_] text_view_] set_editable

Sets the default editability of the B<Gnome::Gtk3::TextView>. You can override
this default setting with tags in the buffer, using the “editable”
attribute of tags.

  method gtk_text_view_set_editable ( Int $setting )

=item Int $setting; whether it’s editable

=end pod

sub gtk_text_view_set_editable ( N-GObject $text_view, int32 $setting )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_editable:
=begin pod
=head2 [[gtk_] text_view_] get_editable

Returns the default editability of the B<Gnome::Gtk3::TextView>. Tags in the
buffer may override this setting for some ranges of text.

Returns: whether text is editable by default

  method gtk_text_view_get_editable ( --> Int  )


=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_overwrite:
=begin pod
=head2 [[gtk_] text_view_] set_overwrite

Changes the B<Gnome::Gtk3::TextView> overwrite mode.

Since: 2.4

  method gtk_text_view_set_overwrite ( Int $overwrite )

=item Int $overwrite; C<1> to turn on overwrite mode, C<0> to turn it off

=end pod

sub gtk_text_view_set_overwrite ( N-GObject $text_view, int32 $overwrite )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_overwrite:
=begin pod
=head2 [[gtk_] text_view_] get_overwrite

Returns whether the B<Gnome::Gtk3::TextView> is in overwrite mode or not.

Returns: whether I<text_view> is in overwrite mode or not.

Since: 2.4

  method gtk_text_view_get_overwrite ( --> Int  )


=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_accepts_tab:
=begin pod
=head2 [[gtk_] text_view_] set_accepts_tab

Sets the behavior of the text widget when the Tab key is pressed.
If I<accepts_tab> is C<1>, a tab character is inserted. If I<accepts_tab>
is C<0> the keyboard focus is moved to the next widget in the focus
chain.

Since: 2.4

  method gtk_text_view_set_accepts_tab ( Int $accepts_tab )

=item Int $accepts_tab; C<1> if pressing the Tab key should insert a tab  character, C<0>, if pressing the Tab key should move the  keyboard focus.

=end pod

sub gtk_text_view_set_accepts_tab ( N-GObject $text_view, int32 $accepts_tab )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_accepts_tab:
=begin pod
=head2 [[gtk_] text_view_] get_accepts_tab

Returns whether pressing the Tab key inserts a tab characters.
C<gtk_text_view_set_accepts_tab()>.

Returns: C<1> if pressing the Tab key inserts a tab character,
C<0> if pressing the Tab key moves the keyboard focus.

Since: 2.4

  method gtk_text_view_get_accepts_tab ( --> Int  )


=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_pixels_above_lines:
=begin pod
=head2 [[gtk_] text_view_] set_pixels_above_lines

Sets the default number of blank pixels above paragraphs in I<text_view>.
Tags in the buffer for I<text_view> may override the defaults.

  method gtk_text_view_set_pixels_above_lines ( Int $pixels_above_lines )

=item Int $pixels_above_lines; pixels above paragraphs

=end pod

sub gtk_text_view_set_pixels_above_lines ( N-GObject $text_view, int32 $pixels_above_lines )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_pixels_above_lines:
=begin pod
=head2 [[gtk_] text_view_] get_pixels_above_lines

Gets the default number of pixels to put above paragraphs.
Adding this function with C<gtk_text_view_get_pixels_below_lines()>
is equal to the line space between each paragraph.

Returns: default number of pixels above paragraphs

  method gtk_text_view_get_pixels_above_lines ( --> Int  )


=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_pixels_below_lines:
=begin pod
=head2 [[gtk_] text_view_] set_pixels_below_lines

Sets the default number of pixels of blank space
to put below paragraphs in I<text_view>. May be overridden
by tags applied to I<text_view>’s buffer.

  method gtk_text_view_set_pixels_below_lines ( Int $pixels_below_lines )

=item Int $pixels_below_lines; pixels below paragraphs

=end pod

sub gtk_text_view_set_pixels_below_lines ( N-GObject $text_view, int32 $pixels_below_lines )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_pixels_below_lines:
=begin pod
=head2 [[gtk_] text_view_] get_pixels_below_lines

Gets the value set by C<gtk_text_view_set_pixels_below_lines()>.

The line space is the sum of the value returned by this function and the
value returned by C<gtk_text_view_get_pixels_above_lines()>.

Returns: default number of blank pixels below paragraphs

  method gtk_text_view_get_pixels_below_lines ( --> Int  )


=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_pixels_inside_wrap:
=begin pod
=head2 [[gtk_] text_view_] set_pixels_inside_wrap

Sets the default number of pixels of blank space to leave between
display/wrapped lines within a paragraph. May be overridden by
tags in I<text_view>’s buffer.

  method gtk_text_view_set_pixels_inside_wrap ( Int $pixels_inside_wrap )

=item Int $pixels_inside_wrap; default number of pixels between wrapped lines

=end pod

sub gtk_text_view_set_pixels_inside_wrap ( N-GObject $text_view, int32 $pixels_inside_wrap )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_pixels_inside_wrap:
=begin pod
=head2 [[gtk_] text_view_] get_pixels_inside_wrap

Gets the value set by C<gtk_text_view_set_pixels_inside_wrap()>.

Returns: default number of pixels of blank space between wrapped lines

  method gtk_text_view_get_pixels_inside_wrap ( --> Int  )


=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_justification:
=begin pod
=head2 [[gtk_] text_view_] set_justification

Sets the default justification of text in I<text_view>.
Tags in the view’s buffer may override the default.


  method gtk_text_view_set_justification ( GtkJustification $justification )

=item GtkJustification $justification; justification

=end pod

sub gtk_text_view_set_justification ( N-GObject $text_view, int32 $justification )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_justification:
=begin pod
=head2 [[gtk_] text_view_] get_justification

Gets the default justification of paragraphs in I<text_view>.
Tags in the buffer may override the default.

Returns: default justification

  method gtk_text_view_get_justification ( --> GtkJustification  )


=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_left_margin:
=begin pod
=head2 [[gtk_] text_view_] set_left_margin

Sets the default left margin for text in I<text_view>.
Tags in the buffer may override the default.

Note that this function is confusingly named.
In CSS terms, the value set here is padding.

  method gtk_text_view_set_left_margin ( Int $left_margin )

=item Int $left_margin; left margin in pixels

=end pod

sub gtk_text_view_set_left_margin ( N-GObject $text_view, int32 $left_margin )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_left_margin:
=begin pod
=head2 [[gtk_] text_view_] get_left_margin

Gets the default left margin size of paragraphs in the I<text_view>.
Tags in the buffer may override the default.

Returns: left margin in pixels

  method gtk_text_view_get_left_margin ( --> Int  )


=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_right_margin:
=begin pod
=head2 [[gtk_] text_view_] set_right_margin

Sets the default right margin for text in the text view.
Tags in the buffer may override the default.

Note that this function is confusingly named.
In CSS terms, the value set here is padding.

  method gtk_text_view_set_right_margin ( Int $right_margin )

=item Int $right_margin; right margin in pixels

=end pod

sub gtk_text_view_set_right_margin ( N-GObject $text_view, int32 $right_margin )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_right_margin:
=begin pod
=head2 [[gtk_] text_view_] get_right_margin

Gets the default right margin for text in I<text_view>. Tags
in the buffer may override the default.

Returns: right margin in pixels

  method gtk_text_view_get_right_margin ( --> Int  )


=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_top_margin:
=begin pod
=head2 [[gtk_] text_view_] set_top_margin

Sets the top margin for text in I<text_view>.

Note that this function is confusingly named.
In CSS terms, the value set here is padding.

Since: 3.18

  method gtk_text_view_set_top_margin ( Int $top_margin )

=item Int $top_margin; top margin in pixels

=end pod

sub gtk_text_view_set_top_margin ( N-GObject $text_view, int32 $top_margin )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_top_margin:
=begin pod
=head2 [[gtk_] text_view_] get_top_margin

Gets the top margin for text in the I<text_view>.

Returns: top margin in pixels

Since: 3.18

  method gtk_text_view_get_top_margin ( --> Int  )


=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_bottom_margin:
=begin pod
=head2 [[gtk_] text_view_] set_bottom_margin

Sets the bottom margin for text in I<text_view>.

Note that this function is confusingly named.
In CSS terms, the value set here is padding.

Since: 3.18

  method gtk_text_view_set_bottom_margin ( Int $bottom_margin )

=item Int $bottom_margin; bottom margin in pixels

=end pod

sub gtk_text_view_set_bottom_margin ( N-GObject $text_view, int32 $bottom_margin )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_bottom_margin:
=begin pod
=head2 [[gtk_] text_view_] get_bottom_margin

Gets the bottom margin for text in the I<text_view>.

Returns: bottom margin in pixels

Since: 3.18

  method gtk_text_view_get_bottom_margin ( --> Int  )


=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_indent:
=begin pod
=head2 [[gtk_] text_view_] set_indent

Sets the default indentation for paragraphs in I<text_view>.
Tags in the buffer may override the default.

  method gtk_text_view_set_indent ( Int $indent )

=item Int $indent; indentation in pixels

=end pod

sub gtk_text_view_set_indent ( N-GObject $text_view, int32 $indent )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_indent:
=begin pod
=head2 [[gtk_] text_view_] get_indent

Gets the default indentation of paragraphs in I<text_view>.
Tags in the view’s buffer may override the default.
The indentation may be negative.

Returns: number of pixels of indentation

  method gtk_text_view_get_indent ( --> Int  )


=end pod

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

#`{{
#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_tabs:
=begin pod
=head2 [[gtk_] text_view_] set_tabs

Sets the default tab stops for paragraphs in I<text_view>.
Tags in the buffer may override the default.

  method gtk_text_view_set_tabs ( PangoTabArray $tabs )

=item PangoTabArray $tabs; tabs as a B<PangoTabArray>

=end pod

sub gtk_text_view_set_tabs ( N-GObject $text_view, PangoTabArray $tabs )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_tabs:
=begin pod
=head2 [[gtk_] text_view_] get_tabs

Gets the default tabs for I<text_view>. Tags in the buffer may
override the defaults. The returned array will be C<Any> if
“standard” (8-space) tabs are used. Free the return value
with C<pango_tab_array_free()>.

Returns: (nullable) (transfer full): copy of default tab array, or C<Any> if
“standard" tabs are used; must be freed with C<pango_tab_array_free()>.

  method gtk_text_view_get_tabs ( --> PangoTabArray  )


=end pod

sub gtk_text_view_get_tabs ( N-GObject $text_view )
  returns PangoTabArray
  is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_default_attributes:
=begin pod
=head2 [[gtk_] text_view_] get_default_attributes

Obtains a copy of the default text attributes. These are the
attributes used for text unless a tag overrides them.
You’d typically pass the default attributes in to
C<gtk_text_iter_get_attributes()> in order to get the
attributes in effect at a given text position.

The return value is a copy owned by the caller of this function,
and should be freed with C<gtk_text_attributes_unref()>.

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

  method gtk_text_view_get_default_attributes ( --> N-GObject  )


=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_input_purpose:
=begin pod
=head2 [[gtk_] text_view_] set_input_purpose

Sets the  I<input-purpose> property which
can be used by on-screen keyboards and other input
methods to adjust their behaviour.

Since: 3.6

  method gtk_text_view_set_input_purpose ( GtkInputPurpose $purpose )

=item GtkInputPurpose $purpose; the purpose

=end pod

sub gtk_text_view_set_input_purpose ( N-GObject $text_view, int32 $purpose )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_input_purpose:
=begin pod
=head2 [[gtk_] text_view_] get_input_purpose

Gets the value of the  I<input-purpose> property.

Since: 3.6

  method gtk_text_view_get_input_purpose ( --> GtkInputPurpose  )


=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_input_hints:
=begin pod
=head2 [[gtk_] text_view_] set_input_hints

Sets the  I<input-hints> property, which
allows input methods to fine-tune their behaviour.

Since: 3.6

  method gtk_text_view_set_input_hints ( GtkInputHints $hints )

=item GtkInputHints $hints; the hints

=end pod

sub gtk_text_view_set_input_hints ( N-GObject $text_view, int32 $hints )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_input_hints:
=begin pod
=head2 [[gtk_] text_view_] get_input_hints

Gets the value of the  I<input-hints> property.

Since: 3.6

  method gtk_text_view_get_input_hints ( --> GtkInputHints  )


=end pod

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

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_set_monospace:
=begin pod
=head2 [[gtk_] text_view_] set_monospace

Sets the  I<monospace> property, which
indicates that the text view should use monospace
fonts.

Since: 3.16

  method gtk_text_view_set_monospace ( Int $monospace )

=item Int $monospace; C<1> to request monospace styling

=end pod

sub gtk_text_view_set_monospace ( N-GObject $text_view, int32 $monospace )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:gtk_text_view_get_monospace:
=begin pod
=head2 [[gtk_] text_view_] get_monospace

Gets the value of the  I<monospace> property.

Return: C<1> if monospace fonts are desired

Since: 3.16

  method gtk_text_view_get_monospace ( --> Int  )


=end pod

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

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

There are two ways to connect to a signal. The first option you have is to use C<register-signal()> from B<Gnome::GObject::Object>. The second option is to use C<g_signal_connect_object()> directly from B<Gnome::GObject::Signal>.

=head2 First method

The positional arguments of the signal handler are all obligatory as well as their types. The named attributes C<:$widget> and user data are optional.

  # handler method
  method mouse-event ( N-GdkEvent $event, :$widget ) { ... }

  # connect a signal on window object
  my Gnome::Gtk3::Window $w .= new( ... );
  $w.register-signal( self, 'mouse-event', 'button-press-event');

=head2 Second method

  my Gnome::Gtk3::Window $w .= new( ... );
  my Callable $handler = sub (
    N-GObject $native, N-GdkEvent $event, OpaquePointer $data
  ) {
    ...
  }

  $w.connect-object( 'button-press-event', $handler);

Also here, the types of positional arguments in the signal handler are important. This is because both methods C<register-signal()> and C<g_signal_connect_object()> are using the signatures of the handler routines to setup the native call interface.

=head2 Supported signals


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

Applications should not connect to it, but may emit it with
C<g_signal_emit_by_name()> if they need to control the cursor
programmatically.

The default bindings for this signal come in two variants,
the variant with the Shift modifier extends the selection,
the variant without the Shift modifer does not.
There are too many key combinations to list them all here.
- Arrow keys move by individual characters/lines
- Ctrl-arrow key combinations move by words/paragraphs
- Home/End keys move to the ends of the buffer
- PageUp/PageDown keys move vertically by pages
- Ctrl-PageUp/PageDown keys move horizontally by pages

  method handler (
    Unknown type GTK_TYPE_MOVEMENT_STEP $step,
    Int $count,
    Int $extend_selection,
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($text_view),
    *%user-options
  );

=item $text_view; the object which received the signal

=item $step; the granularity of the move, as a B<Gnome::Gtk3::MovementStep>

=item $count; the number of I<step> units to move

=item $extend_selection; C<1> if the move should extend the selection



=comment #TS:0:move-viewport:
=head3 move-viewport

The I<move-viewport> signal is a
[keybinding signal][B<Gnome::Gtk3::BindingSignal>]
which can be bound to key combinations to allow the user
to move the viewport, i.e. change what part of the text view
is visible in a containing scrolled window.

There are no default bindings for this signal.

  method handler (
    Unknown type GTK_TYPE_SCROLL_STEP $step,
    Int $count,
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($text_view),
    *%user-options
  );

=item $text_view; the object which received the signal

=item $step; the granularity of the movement, as a B<Gnome::Gtk3::ScrollStep>

=item $count; the number of I<step> units to move


=comment #TS:0:set-anchor:
=head3 set-anchor

The I<set-anchor> signal is a
[keybinding signal][B<Gnome::Gtk3::BindingSignal>]
which gets emitted when the user initiates setting the "anchor"
mark. The "anchor" mark gets placed at the same position as the
"insert" mark.

This signal has no default bindings.

  method handler (
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($text_view),
    *%user-options
  );

=item $text_view; the object which received the signal


=comment #TS:0:insert-at-cursor:
=head3 insert-at-cursor

The I<insert-at-cursor> signal is a
[keybinding signal][B<Gnome::Gtk3::BindingSignal>]
which gets emitted when the user initiates the insertion of a
fixed string at the cursor.

This signal has no default bindings.

  method handler (
    Str $string,
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($text_view),
    *%user-options
  );

=item $text_view; the object which received the signal

=item $string; the string to insert


=comment #TS:0:delete-from-cursor:
=head3 delete-from-cursor

The I<delete-from-cursor> signal is a
[keybinding signal][B<Gnome::Gtk3::BindingSignal>]
which gets emitted when the user initiates a text deletion.

If the I<type> is C<GTK_DELETE_CHARS>, GTK+ deletes the selection
if there is one, otherwise it deletes the requested number
of characters.

The default bindings for this signal are
Delete for deleting a character, Ctrl-Delete for
deleting a word and Ctrl-Backspace for deleting a word
backwords.

  method handler (
    Unknown type GTK_TYPE_DELETE_TYPE $type,
    Int $count,
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($text_view),
    *%user-options
  );

=item $text_view; the object which received the signal

=item $type; the granularity of the deletion, as a B<Gnome::Gtk3::DeleteType>

=item $count; the number of I<type> units to delete


=comment #TS:0:backspace:
=head3 backspace

The I<backspace> signal is a
[keybinding signal][B<Gnome::Gtk3::BindingSignal>]
which gets emitted when the user asks for it.

The default bindings for this signal are
Backspace and Shift-Backspace.

  method handler (
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($text_view),
    *%user-options
  );

=item $text_view; the object which received the signal


=comment #TS:0:cut-clipboard:
=head3 cut-clipboard

The I<cut-clipboard> signal is a
[keybinding signal][B<Gnome::Gtk3::BindingSignal>]
which gets emitted to cut the selection to the clipboard.

The default bindings for this signal are
Ctrl-x and Shift-Delete.

  method handler (
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($text_view),
    *%user-options
  );

=item $text_view; the object which received the signal


=comment #TS:0:copy-clipboard:
=head3 copy-clipboard

The I<copy-clipboard> signal is a
[keybinding signal][B<Gnome::Gtk3::BindingSignal>]
which gets emitted to copy the selection to the clipboard.

The default bindings for this signal are
Ctrl-c and Ctrl-Insert.

  method handler (
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($text_view),
    *%user-options
  );

=item $text_view; the object which received the signal


=comment #TS:0:paste-clipboard:
=head3 paste-clipboard

The I<paste-clipboard> signal is a
[keybinding signal][B<Gnome::Gtk3::BindingSignal>]
which gets emitted to paste the contents of the clipboard
into the text view.

The default bindings for this signal are
Ctrl-v and Shift-Insert.

  method handler (
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($text_view),
    *%user-options
  );

=item $text_view; the object which received the signal


=comment #TS:0:toggle-overwrite:
=head3 toggle-overwrite

The I<toggle-overwrite> signal is a
[keybinding signal][B<Gnome::Gtk3::BindingSignal>]
which gets emitted to toggle the overwrite mode of the text view.

The default bindings for this signal is Insert.

  method handler (
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($text_view),
    *%user-options
  );

=item $text_view; the object which received the signal


=comment #TS:0:populate-popup:
=head3 populate-popup

The I<populate-popup> signal gets emitted before showing the
context menu of the text view.

If you need to add items to the context menu, connect
to this signal and append your items to the I<popup>, which
will be a B<Gnome::Gtk3::Menu> in this case.

If  I<populate-all> is C<1>, this signal will
also be emitted to populate touch popups. In this case,
I<popup> will be a different container, e.g. a B<Gnome::Gtk3::Toolbar>.

The signal handler should not make assumptions about the
type of I<widget>, but check whether I<popup> is a B<Gnome::Gtk3::Menu>
or B<Gnome::Gtk3::Toolbar> or another kind of container.

  method handler (
    N-GObject $popup,
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($text_view),
    *%user-options
  );

=item $text_view; The text view on which the signal is emitted

=item $popup; the container that is being populated


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

The I<select-all> signal is a
[keybinding signal][B<Gnome::Gtk3::BindingSignal>]
which gets emitted to select or unselect the complete
contents of the text view.

The default bindings for this signal are Ctrl-a and Ctrl-/
for selecting and Shift-Ctrl-a and Ctrl-\ for unselecting.

  method handler (
    Int $select,
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($text_view),
    *%user-options
  );

=item $text_view; the object which received the signal

=item $select; C<1> to select, C<0> to unselect


=comment #TS:0:toggle-cursor-visible:
=head3 toggle-cursor-visible

The I<toggle-cursor-visible> signal is a
[keybinding signal][B<Gnome::Gtk3::BindingSignal>]
which gets emitted to toggle the  I<cursor-visible>
property.

The default binding for this signal is F7.

  method handler (
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($text_view),
    *%user-options
  );

=item $text_view; the object which received the signal


=comment #TS:0:preedit-changed:
=head3 preedit-changed

If an input method is used, the typed text will not immediately
be committed to the buffer. So if you are interested in the text,
connect to this signal.

This signal is only emitted if the text at the given position
is actually editable.

Since: 2.20

  method handler (
    Str $preedit,
    Int :$_handler_id,
    Gnome::GObject::Object :_widget($text_view),
    *%user-options
  );

=item $text_view; the object which received the signal
=item $preedit; the current preedit string


=begin comment
=comment #TS:0:extend-selection:
=head3 extend-selection

The I<extend-selection> signal is emitted when the selection needs to be
extended at I<location>.

Returns: C<GDK_EVENT_STOP> to stop other handlers from being invoked for the
event.