### ----------------------------------------------------
### -- Gnome::Gtk3
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gtk3/Widget.rakumod
### ----------------------------------------------------
### -- Chunk 5 of 8
 --> N-GList
) is native(&gtk-lib)
  { * }

#`{{ TODO do we implement widgets?
#-------------------------------------------------------------------------------
# TM:0:map:
=begin pod
=head2 map

This function is only for use in widget implementations. Causes a widget to be mapped if it isn’t already.

  method map ( )

=end pod

method map ( ) {
  gtk_widget_map(self._f('GtkWidget'));
}

sub gtk_widget_map (
  N-GObject $widget
) is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:mnemonic-activate:
=begin pod
=head2 mnemonic-activate

Emits the I<mnemonic-activate> signal.

Returns: C<True> if the signal has been handled

  method mnemonic-activate ( Bool $group_cycling --> Bool )

=item Bool $group_cycling; C<True> if there are other widgets with the same mnemonic

=end pod

method mnemonic-activate ( Bool $group_cycling --> Bool ) {
  gtk_widget_mnemonic_activate( self._f('GtkWidget'), $group_cycling).Bool
}

sub gtk_widget_mnemonic_activate (
  N-GObject $widget, gboolean $group_cycling --> gboolean
) is native(&gtk-lib)
  { * }

#`{{ TODO widget implementation?
#-------------------------------------------------------------------------------
# TM:0:queue-allocate:
=begin pod
=head2 queue-allocate

This function is only for use in widget implementations.

Flags the widget for a rerun of the GtkWidgetClass::size-allocate function. Use this function instead of C<queue-resize()> when the I<widget>'s size request didn't change but it wants to reposition its contents.

An example user of this function is C<set-halign()>.

  method queue-allocate ( )

=end pod

method queue-allocate ( ) {
  gtk_widget_queue_allocate(self._f('GtkWidget'));
}

sub gtk_widget_queue_allocate (
  N-GObject $widget
) is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:queue-compute-expand:
=begin pod
=head2 queue-compute-expand

Mark I<widget> as needing to recompute its expand flags. Call this function when setting legacy expand child properties on the child of a container.

See C<compute-expand()>.

  method queue-compute-expand ( )

=end pod

method queue-compute-expand ( ) {
  gtk_widget_queue_compute_expand(self._f('GtkWidget'));
}

sub gtk_widget_queue_compute_expand (
  N-GObject $widget
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:queue-draw:
=begin pod
=head2 queue-draw

Equivalent to calling C<queue-draw-area()> for the entire area of a widget.

  method queue-draw ( )

=end pod

method queue-draw ( ) {
  gtk_widget_queue_draw(self._f('GtkWidget'));
}

sub gtk_widget_queue_draw (
  N-GObject $widget
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:queue-draw-area:
=begin pod
=head2 queue-draw-area

Convenience function that calls C<queue-draw-region()> on the region created from the given coordinates.

The region here is specified in widget coordinates. Widget coordinates are a bit odd; for historical reasons, they are defined as I<widget>->window coordinates for widgets that return C<True> for C<get-has-window()>, and are relative to I<widget>->allocation.x, I<widget>->allocation.y otherwise.

I<width> or I<height> may be 0, in this case this function does nothing. Negative values for I<width> and I<height> are not allowed.

  method queue-draw-area ( Int $x, Int $y, Int $width, Int $height )

=item Int $x; x coordinate of upper-left corner of rectangle to redraw
=item Int $y; y coordinate of upper-left corner of rectangle to redraw
=item Int $width; width of region to draw
=item Int $height; height of region to draw

=end pod

method queue-draw-area ( Int $x, Int $y, Int $width, Int $height ) {
  gtk_widget_queue_draw_area( self._f('GtkWidget'), $x, $y, $width, $height);
}

sub gtk_widget_queue_draw_area (
  N-GObject $widget, gint $x, gint $y, gint $width, gint $height
) is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:queue-draw-region:
=begin pod
=head2 queue-draw-region

Invalidates the area of I<widget> defined by I<region> by calling C<gdk-window-invalidate-region()> on the widget’s window and all its child windows. Once the main loop becomes idle (after the current batch of events has been processed, roughly), the window will receive expose events for the union of all regions that have been invalidated.

Normally you would only use this function in widget implementations. You might also use it to schedule a redraw of a B<Gnome::Gtk3::DrawingArea> or some portion thereof.

  method queue-draw-region ( cairo_region_t $region )

=item cairo_region_t $region; region to draw

=end pod

method queue-draw-region ( cairo_region_t $region ) {

  gtk_widget_queue_draw_region(
    self._f('GtkWidget'), $region
  );
}

sub gtk_widget_queue_draw_region (
  N-GObject $widget, cairo_region_t $region
) is native(&gtk-lib)
  { * }
}}

#`{{ TODO widget implementation
#-------------------------------------------------------------------------------
# TM:0:queue-resize:
=begin pod
=head2 queue-resize

This function is only for use in widget implementations. Flags a widget to have its size renegotiated; should be called when a widget for some reason has a new size request. For example, when you change the text in a B<Gnome::Gtk3::Label>, B<Gnome::Gtk3::Label> queues a resize to ensure there’s enough space for the new text.

Note that you cannot call C<queue-resize()> on a widget from inside its implementation of the GtkWidgetClass::size-allocate virtual method. Calls to C<queue-resize()> from inside GtkWidgetClass::size-allocate will be silently ignored.

  method queue-resize ( )

=end pod

method queue-resize ( ) {
  gtk_widget_queue_resize(self._f('GtkWidget'));
}

sub gtk_widget_queue_resize (
  N-GObject $widget
) is native(&gtk-lib)
  { * }
}}

#`{{ TODO widget implementation
#-------------------------------------------------------------------------------
# TM:0:queue-resize-no-redraw:
=begin pod
=head2 queue-resize-no-redraw

This function works like C<queue-resize()>, except that the widget is not invalidated.

  method queue-resize-no-redraw ( )

=end pod

method queue-resize-no-redraw ( ) {
  gtk_widget_queue_resize_no_redraw(self._f('GtkWidget'));
}

sub gtk_widget_queue_resize_no_redraw (
  N-GObject $widget
) is native(&gtk-lib)
  { * }
}}

#`{{ TODO widget implementation
#-------------------------------------------------------------------------------
# TM:0:realize:
=begin pod
=head2 realize

Creates the GDK (windowing system) resources associated with a widget. For example, I<widget>->window will be created when a widget is realized. Normally realization happens implicitly; if you show a widget and all its parent containers, then the widget will be realized and mapped automatically.

Realizing a widget requires all the widget’s parent widgets to be realized; calling C<realize()> realizes the widget’s parents in addition to I<widget> itself. If a widget is not yet inside a toplevel window when you realize it, bad things will happen.

This function is primarily used in widget implementations, and isn’t very useful otherwise. Many times when you think you might need it, a better approach is to connect to a signal that will be called after the widget is realized automatically, such as  I<draw>. Or simply C<g-signal-connect()> to the  I<realize> signal.

  method realize ( )

=end pod

method realize ( ) {
  gtk_widget_realize(self._f('GtkWidget'));
}

sub gtk_widget_realize (
  N-GObject $widget
) is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:register-window:
=begin pod
=head2 register-window

Registers a B<Gnome::Gtk3::Window> with the widget and sets it up so that the widget receives events for it. Call C<unregister-window()> when destroying the window.

  method register-window ( N-GObject $window )

=item N-GObject $window; a B<Gnome::Gtk3::Window>

=end pod

method register-window ( $window is copy ) {
  $window .= _get-native-object-no-reffing unless $window ~~ N-GObject;
  gtk_widget_register_window( self._f('GtkWidget'), $window);
}

sub gtk_widget_register_window (
  N-GObject $widget, N-GObject $window
) is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:remove-accelerator:
=begin pod
=head2 remove-accelerator

Removes an accelerator from I<widget>, previously installed with C<add-accelerator()>.

Returns: whether an accelerator was installed and could be removed

  method remove-accelerator ( N-GObject $accel_group, UInt $accel_key, GdkModifierType $accel_mods --> Bool )

=item N-GObject $accel_group; accel group for this widget
=item UInt $accel_key; GDK keyval of the accelerator
=item GdkModifierType $accel_mods; modifier key combination of the accelerator

=end pod

method remove-accelerator ( $accel_group is copy, UInt $accel_key, GdkModifierType $accel_mods --> Bool ) {
  $accel_group .= _get-native-object-no-reffing unless $accel_group ~~ N-GObject;

  gtk_widget_remove_accelerator(
    self._f('GtkWidget'), $accel_group, $accel_key, $accel_mods
  ).Bool
}

sub gtk_widget_remove_accelerator (
  N-GObject $widget, N-GObject $accel_group, guint $accel_key, GEnum $accel_mods --> gboolean
) is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:remove-mnemonic-label:
=begin pod
=head2 remove-mnemonic-label

Removes a widget from the list of mnemonic labels for this widget. (See C<list-mnemonic-labels()>). The widget must have previously been added to the list with C<add-mnemonic-label()>.

  method remove-mnemonic-label ( N-GObject $label )

=item N-GObject $label; a B<Gnome::Gtk3::Widget> that was previously set as a mnemonic label for I<widget> with C<add-mnemonic-label()>.

=end pod

method remove-mnemonic-label ( $label is copy ) {
  $label .= _get-native-object-no-reffing unless $label ~~ N-GObject;
  gtk_widget_remove_mnemonic_label( self._f('GtkWidget'), $label);
}

sub gtk_widget_remove_mnemonic_label (
  N-GObject $widget, N-GObject $label
) is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:remove-tick-callback:
=begin pod
=head2 remove-tick-callback

Removes a tick callback previously registered with C<add-tick-callback()>.

  method remove-tick-callback ( UInt $id )

=item UInt $id; an id returned by C<add-tick-callback()>

=end pod

method remove-tick-callback ( UInt $id ) {
  gtk_widget_remove_tick_callback( self._f('GtkWidget'), $id);
}

sub gtk_widget_remove_tick_callback (
  N-GObject $widget, guint $id
) is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:reset-style:
=begin pod
=head2 reset-style

Updates the style context of I<widget> and all descendants by updating its widget path. B<Gnome::Gtk3::Containers> may want to use this on a child when reordering it in a way that a different style might apply to it. See also C<gtk-container-get-path-for-child()>.

  method reset-style ( )

=end pod

method reset-style ( ) {
  gtk_widget_reset_style(self._f('GtkWidget'));
}

sub gtk_widget_reset_style (
  N-GObject $widget
) is native(&gtk-lib)
  { * }

#`{{ TODO widget implementation
#-------------------------------------------------------------------------------
# TM:0:send-focus-change:
=begin pod
=head2 send-focus-change

Sends the focus change I<event> to I<widget>

This function is not meant to be used by applications. The only time it should be used is when it is necessary for a B<Gnome::Gtk3::Widget> to assign focus to a widget that is semantically owned by the first widget even though it’s not a direct child - for instance, a search entry in a floating window similar to the quick search in B<Gnome::Gtk3::TreeView>.

An example of its usage is:

|[<!-- language="C" --> GdkEvent *fevent = gdk-event-new (GDK-FOCUS-CHANGE);

fevent->focus-change.type = GDK-FOCUS-CHANGE; fevent->focus-change.in = TRUE; fevent->focus-change.window = -get-window (widget); if (fevent->focus-change.window != NULL) g-object-ref (fevent->focus-change.window);

gtk-widget-send-focus-change (widget, fevent);

gdk-event-free (event); ]|

Returns: the return value from the event signal emission: C<True> if the event was handled, and C<False> otherwise

  method send-focus-change ( GdkEvent $event --> Bool )

=item GdkEvent $event; a B<Gnome::Gtk3::Event> of type GDK-FOCUS-CHANGE

=end pod

method send-focus-change ( GdkEvent $event --> Bool ) {

  gtk_widget_send_focus_change(
    self._f('GtkWidget'), $event
  ).Bool
}

sub gtk_widget_send_focus_change (
  N-GObject $widget, GdkEvent $event --> gboolean
) is native(&gtk-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
#TM:0:set-accel-path:
=begin pod
=head2 set-accel-path

Given an accelerator group, I<accel-group>, and an accelerator path, I<accel-path>, sets up an accelerator in I<accel-group> so whenever the key binding that is defined for I<accel-path> is pressed, I<widget> will be activated. This removes any accelerators (for any accelerator group) installed by previous calls to C<set-accel-path()>. Associating accelerators with paths allows them to be modified by the user and the modifications to be saved for future use. (See C<gtk-accel-map-save()>.)

This function is a low level function that would most likely be used by a menu creation system like B<Gnome::Gtk3::UIManager>. If you use B<Gnome::Gtk3::UIManager>, setting up accelerator paths will be done automatically.

Even when you you aren’t using B<Gnome::Gtk3::UIManager>, if you only want to set up accelerators on menu items C<gtk-menu-item-set-accel-path()> provides a somewhat more convenient interface.

Note that I<accel-path> string will be stored in a B<Gnome::Gtk3::Quark>. Therefore, if you pass a static string, you can save some memory by interning it first with C<g-intern-static-string()>.

  method set-accel-path ( Str $accel_path, N-GObject $accel_group )

=item Str $accel_path; path used to look up the accelerator
=item N-GObject $accel_group; a B<Gnome::Gtk3::AccelGroup>.

=end pod

method set-accel-path ( Str $accel_path, $accel_group is copy ) {
  $accel_group .= _get-native-object-no-reffing unless $accel_group ~~ N-GObject;

  gtk_widget_set_accel_path(
    self._f('GtkWidget'), $accel_path, $accel_group
  );
}

sub gtk_widget_set_accel_path (
  N-GObject $widget, gchar-ptr $accel_path, N-GObject $accel_group
) is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:0:set-allocation:
=begin pod
=head2 set-allocation

Sets the widget’s allocation. This should not be used directly, but from within a widget’s size-allocate method.

The allocation set should be the “adjusted” or actual allocation. If you’re implementing a B<Gnome::Gtk3::Container>, you want to use C<size-allocate()> instead of C<set-allocation()>. The GtkWidgetClass::adjust-size-allocation virtual method adjusts the allocation inside C<size-allocate()> to create an adjusted allocation.

  method set-allocation ( N-GtkAllocation $allocation )

=item N-GtkAllocation $allocation; a pointer to a B<Gnome::Gtk3::Allocation> to copy from

=end pod

method set-allocation ( N-GtkAllocation $allocation ) {
  gtk_widget_set_allocation( self._f('GtkWidget'), $allocation);
}

sub gtk_widget_set_allocation (
  N-GObject $widget, N-GtkAllocation $allocation
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-app-paintable:
=begin pod
=head2 set-app-paintable

Sets whether the application intends to draw on the widget in an  I<draw> handler.

This is a hint to the widget and does not affect the behavior of the GTK+ core; many widgets ignore this flag entirely. For widgets that do pay attention to the flag, such as B<Gnome::Gtk3::EventBox> and B<Gnome::Gtk3::Window>, the effect is to suppress default themed drawing of the widget's background. (Children of the widget will still be drawn.) The application is then entirely responsible for drawing the widget background.

Note that the background is still drawn when the widget is mapped.

  method set-app-paintable ( Bool $app_paintable )

=item Bool $app_paintable; C<True> if the application will paint on the widget

=end pod

method set-app-paintable ( Bool $app_paintable ) {

  gtk_widget_set_app_paintable(
    self._f('GtkWidget'), $app_paintable
  );
}

sub gtk_widget_set_app_paintable (
  N-GObject $widget, gboolean $app_paintable
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-can-default:
=begin pod
=head2 set-can-default

Specifies whether I<widget> can be a default widget. See C<grab-default()> for details about the meaning of “default”.

  method set-can-default ( Bool $can_default )

=item Bool $can_default; whether or not I<widget> can be a default widget.

=end pod

method set-can-default ( Bool $can_default ) {
  gtk_widget_set_can_default( self._f('GtkWidget'), $can_default);
}

sub gtk_widget_set_can_default (
  N-GObject $widget, gboolean $can_default
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-can-focus:
=begin pod
=head2 set-can-focus

Specifies whether I<widget> can own the input focus. See C<grab-focus()> for actually setting the input focus on a widget.

  method set-can-focus ( Bool $can_focus )

=item Bool $can_focus; whether or not I<widget> can own the input focus.

=end pod

method set-can-focus ( Bool $can_focus ) {
  gtk_widget_set_can_focus( self._f('GtkWidget'), $can_focus);
}

sub gtk_widget_set_can_focus (
  N-GObject $widget, gboolean $can_focus
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-child-visible:
=begin pod
=head2 set-child-visible

Sets whether I<widget> should be mapped along with its when its parent is mapped and I<widget> has been shown with C<show()>.

The child visibility can be set for widget before it is added to a container with C<set-parent()>, to avoid mapping children unnecessary before immediately unmapping them. However it will be reset to its default state of C<True> when the widget is removed from a container.

Note that changing the child visibility of a widget does not queue a resize on the widget. Most of the time, the size of a widget is computed from all visible children, whether or not they are mapped. If this is not the case, the container can queue a resize itself.

This function is only useful for container implementations and never should be called by an application.

  method set-child-visible ( Bool $is_visible )

=item Bool $is_visible; if C<True>, I<widget> should be mapped along with its parent.

=end pod

method set-child-visible ( Bool $is_visible ) {
  gtk_widget_set_child_visible( self._f('GtkWidget'), $is_visible);
}

sub gtk_widget_set_child_visible (
  N-GObject $widget, gboolean $is_visible
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-clip:
=begin pod
=head2 set-clip

Sets the widget’s clip. This must not be used directly, but from within a widget’s size-allocate method. It must be called after C<set-allocation()> (or after chaining up to the parent class), because that function resets the clip.

The clip set should be the area that I<widget> draws on. If I<widget> is a B<Gnome::Gtk3::Container>, the area must contain all children's clips.

If this function is not called by I<widget> during a I<size-allocate> handler, the clip will be set to I<widget>'s allocation.

  method set-clip ( N-GtkAllocation $clip )

=item N-GtkAllocation $clip; a pointer to a B<Gnome::Gtk3::Allocation> to copy from

=end pod

method set-clip ( N-GtkAllocation $clip ) {
  gtk_widget_set_clip( self._f('GtkWidget'), $clip);
}

sub gtk_widget_set_clip (
  N-GObject $widget, N-GtkAllocation $clip
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-default-direction:
=begin pod
=head2 set-default-direction

Sets the default reading direction for widgets where the direction has not been explicitly set by C<set-direction()>.

  method set-default-direction ( GtkTextDirection $dir )

=item GtkTextDirection $dir; the new default direction. This cannot be C<GTK-TEXT-DIR-NONE>.

=end pod

method set-default-direction ( GtkTextDirection $dir ) {
  gtk_widget_set_default_direction($dir);
}

sub gtk_widget_set_default_direction ( GEnum $dir )
  is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-device-enabled:
=begin pod
=head2 set-device-enabled

Enables or disables a B<Gnome::Gdk3::Device> to interact with I<widget> and all its children.

It does so by descending through the B<Gnome::Gtk3::Window> hierarchy and enabling the same mask that is has for core events (i.e. the one that C<gdk-window-get-events()> returns).

  method set-device-enabled ( N-GObject $device, Bool $enabled )

=item N-GObject $device; a B<Gnome::Gdk3::Device>
=item Bool $enabled; whether to enable the device

=end pod

method set-device-enabled ( $device is copy, Bool $enabled ) {
  $device .= _get-native-object-no-reffing unless $device ~~ N-GObject;
  gtk_widget_set_device_enabled( self._f('GtkWidget'), $device, $enabled);
}

sub gtk_widget_set_device_enabled (
  N-GObject $widget, N-GObject $device, gboolean $enabled
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-device-events:
=begin pod
=head2 set-device-events

Sets the device event mask (see B<Gnome::Gtk3::EventMask>) for a widget. The event mask determines which events a widget will receive from I<device>. Keep in mind that different widgets have different default event masks, and by changing the event mask you may disrupt a widget’s functionality, so be careful. This function must be called while a widget is unrealized. Consider C<add-device-events()> for widgets that are already realized, or if you want to preserve the existing event mask. This function can’t be used with windowless widgets (which return C<False> from C<get-has-window()>); to get events on those widgets, place them inside a B<Gnome::Gtk3::EventBox> and receive events on the event box.

  method set-device-events ( N-GObject $device, Int $events )

=item N-GObject $device; a B<Gnome::Gdk3::Device>
=item Int $events; event mask with GdkEventMask flag values

=end pod

method set-device-events ( $device is copy, Int $events ) {
  $device .= _get-native-object-no-reffing unless $device ~~ N-GObject;
  gtk_widget_set_device_events( self._f('GtkWidget'), $device, $events);
}

sub gtk_widget_set_device_events (
  N-GObject $widget, N-GObject $device, GFlag $events
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-direction:
=begin pod
=head2 set-direction

Sets the reading direction on a particular widget. This direction controls the primary direction for widgets containing text, and also the direction in which the children of a container are packed. The ability to set the direction is present in order so that correct localization into languages with right-to-left reading directions can be done. Generally, applications will let the default reading direction present, except for containers where the containers are arranged in an order that is explicitly visual rather than logical (such as buttons for text justification).

If the direction is set to C<GTK-TEXT-DIR-NONE>, then the value set by C<set-default-direction()> will be used.

  method set-direction ( GtkTextDirection $dir )

=item GtkTextDirection $dir; the new direction

=end pod

method set-direction ( GtkTextDirection $dir ) {
  gtk_widget_set_direction(
    self._f('GtkWidget'), $dir
  );
}

sub gtk_widget_set_direction (
  N-GObject $widget, GEnum $dir
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-events:
=begin pod
=head2 set-events

Sets the event mask (see B<Gnome::Gtk3::EventMask>) for a widget. The event mask determines which events a widget will receive. Keep in mind that different widgets have different default event masks, and by changing the event mask you may disrupt a widget’s functionality, so be careful. This function must be called while a widget is unrealized. Consider C<add-events()> for widgets that are already realized, or if you want to preserve the existing event mask. This function can’t be used with widgets that have no window. (See C<get-has-window()>). To get events on those widgets, place them inside a B<Gnome::Gtk3::EventBox> and receive events on the event box.

  method set-events ( Int $events )

=item Int $events; event mask

=end pod

method set-events ( Int $events ) {
  gtk_widget_set_events( self._f('GtkWidget'), $events);
}

sub gtk_widget_set_events (
  N-GObject $widget, gint $events
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-focus-on-click:
=begin pod
=head2 set-focus-on-click

Sets whether the widget should grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don’t want the keyboard focus removed from the main area of the application.

  method set-focus-on-click ( Bool $focus_on_click )

=item Bool $focus_on_click; whether the widget should grab focus when clicked with the mouse

=end pod

method set-focus-on-click ( Bool $focus_on_click ) {
  gtk_widget_set_focus_on_click( self._f('GtkWidget'), $focus_on_click);
}

sub gtk_widget_set_focus_on_click (
  N-GObject $widget, gboolean $focus_on_click
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-font-map:
=begin pod
=head2 set-font-map

Sets the font map to use for Pango rendering. When not set, the widget will inherit the font map from its parent.

  method set-font-map ( N-GObject $font_map )

=item N-GObject $font_map; a B<PangoFontMap>, or C<undefined> to unset any previously set font map

=end pod

method set-font-map ( $font_map is copy ) {
  $font_map .= _get-native-object-no-reffing unless $font_map ~~ N-GObject;
  gtk_widget_set_font_map( self._f('GtkWidget'), $font_map);
}

sub gtk_widget_set_font_map (
  N-GObject $widget, N-GObject $font_map
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-font-options:
=begin pod
=head2 set-font-options

Sets the B<cairo-font-options-t> used for Pango rendering in this widget. When not set, the default font options for the B<Gnome::Gdk3::Screen> will be used.

  method set-font-options ( cairo_font_options_t $options )

=item cairo_font_options_t $options; a B<cairo-font-options-t>, or C<undefined> to unset any previously set default font options.

=end pod

method set-font-options ( cairo_font_options_t $options ) {
  gtk_widget_set_font_options( self._f('GtkWidget'), $options);
}

sub gtk_widget_set_font_options (
  N-GObject $widget, cairo_font_options_t $options
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-halign:
=begin pod
=head2 set-halign

Sets the horizontal alignment of I<widget>. See the  I<halign> property.

  method set-halign ( GtkAlign $align )

=item GtkAlign $align; the horizontal alignment

=end pod

method set-halign ( GtkAlign $align ) {
  gtk_widget_set_halign( self._f('GtkWidget'), $align);
}

sub gtk_widget_set_halign (
  N-GObject $widget, GEnum $align
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-has-tooltip:
=begin pod
=head2 set-has-tooltip

Sets the has-tooltip property on I<widget> to I<has-tooltip>. See  I<has-tooltip> for more information.

  method set-has-tooltip ( Bool $has_tooltip )

=item Bool $has_tooltip; whether or not I<widget> has a tooltip.

=end pod

method set-has-tooltip ( Bool $has_tooltip ) {
  gtk_widget_set_has_tooltip( self._f('GtkWidget'), $has_tooltip);
}

sub gtk_widget_set_has_tooltip (
  N-GObject $widget, gboolean $has_tooltip
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-has-window:
=begin pod
=head2 set-has-window

Specifies whether I<widget> has a B<Gnome::Gtk3::Window> of its own. Note that all realized widgets have a non-C<undefined> “window” pointer (C<get-window()> never returns a C<undefined> window when a widget is realized), but for many of them it’s actually the B<Gnome::Gtk3::Window> of one of its parent widgets. Widgets that do not create a C<window> for themselves in  I<realize> must announce this by calling this function with I<has-window> = C<False>.

This function should only be called by widget implementations, and they should call it in their C<init()> function.

  method set-has-window ( Bool $has_window )

=item Bool $has_window; whether or not I<widget> has a window.

=end pod

method set-has-window ( Bool $has_window ) {
  gtk_widget_set_has_window( self._f('GtkWidget'), $has_window);
}

sub gtk_widget_set_has_window (
  N-GObject $widget, gboolean $has_window
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-hexpand:
=begin pod
=head2 set-hexpand

Sets whether the widget would like any available extra horizontal space. When a user resizes a B<Gnome::Gtk3::Window>, widgets with expand=TRUE generally receive the extra space. For example, a list or scrollable area or document in your window would often be set to expand.

Call this function to set the expand flag if you would like your widget to become larger horizontally when the window has extra room.

By default, widgets automatically expand if any of their children want to expand. (To see if a widget will automatically expand given its current children and state, call C<compute-expand()>. A container can decide how the expandability of children affects the expansion of the container by overriding the compute-expand virtual method on B<Gnome::Gtk3::Widget>.).

Setting hexpand explicitly with this function will override the automatic expand behavior.

This function forces the widget to expand or not to expand, regardless of children. The override occurs because C<set-hexpand()> sets the hexpand-set property (see C<set-hexpand-set()>) which causes the widget’s hexpand value to be used, rather than looking at children and widget state.

  method set-hexpand ( Bool $expand )

=item Bool $expand; whether to expand

=end pod

method set-hexpand ( Bool $expand ) {
  gtk_widget_set_hexpand( self._f('GtkWidget'), $expand);
}

sub gtk_widget_set_hexpand (
  N-GObject $widget, gboolean $expand
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-hexpand-set:
=begin pod
=head2 set-hexpand-set

Sets whether the hexpand flag (see C<get-hexpand()>) will be used.

The hexpand-set property will be set automatically when you call C<set-hexpand()> to set hexpand, so the most likely reason to use this function would be to unset an explicit expand flag.

If hexpand is set, then it overrides any computed expand value based on child widgets. If hexpand is not set, then the expand value depends on whether any children of the widget would like to expand.

There are few reasons to use this function, but it’s here for completeness and consistency.

  method set-hexpand-set ( Bool $set )

=item Bool $set; value for hexpand-set property

=end pod

method set-hexpand-set ( Bool $set ) {
  gtk_widget_set_hexpand_set( self._f('GtkWidget'), $set);
}

sub gtk_widget_set_hexpand_set (
  N-GObject $widget, gboolean $set
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-mapped:
=begin pod
=head2 set-mapped

Marks the widget as being mapped.

This function should only ever be called in a derived widget's “map” or “unmap” implementation.

  method set-mapped ( Bool $mapped )

=item Bool $mapped; C<True> to mark the widget as mapped

=end pod

method set-mapped ( Bool $mapped ) {
  gtk_widget_set_mapped( self._f('GtkWidget'), $mapped);
}

sub gtk_widget_set_mapped (
  N-GObject $widget, gboolean $mapped
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-margin-bottom:
=begin pod
=head2 set-margin-bottom

Sets the bottom margin of I<widget>. See the  I<margin-bottom> property.

  method set-margin-bottom ( Int $margin )

=item Int $margin; the bottom margin

=end pod

method set-margin-bottom ( Int $margin ) {
  gtk_widget_set_margin_bottom( self._f('GtkWidget'), $margin);
}

sub gtk_widget_set_margin_bottom (
  N-GObject $widget, gint $margin
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-margin-end:
=begin pod
=head2 set-margin-end

Sets the end margin of I<widget>. See the  I<margin-end> property.

  method set-margin-end ( Int $margin )

=item Int $margin; the end margin

=end pod

method set-margin-end ( Int $margin ) {
  gtk_widget_set_margin_end( self._f('GtkWidget'), $margin);
}

sub gtk_widget_set_margin_end (
  N-GObject $widget, gint $margin
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-margin-start:
=begin pod
=head2 set-margin-start

Sets the start margin of I<widget>. See the  I<margin-start> property.

  method set-margin-start ( Int $margin )

=item Int $margin; the start margin

=end pod

method set-margin-start ( Int $margin ) {
  gtk_widget_set_margin_start( self._f('GtkWidget'), $margin);
}

sub gtk_widget_set_margin_start (
  N-GObject $widget, gint $margin
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-margin-top:
=begin pod
=head2 set-margin-top

Sets the top margin of I<widget>. See the  I<margin-top> property.

  method set-margin-top ( Int $margin )

=item Int $margin; the top margin

=end pod

method set-margin-top ( Int $margin ) {
  gtk_widget_set_margin_top( self._f('GtkWidget'), $margin);
}

sub gtk_widget_set_margin_top (
  N-GObject $widget, gint $margin
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-name:
=begin pod
=head2 set-name

Widgets can be named, which allows you to refer to them from a CSS file. You can apply a style to widgets with a particular name in the