### ----------------------------------------------------
### -- Gnome::Gtk3
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: docs/content-docs/reference/Gtk3/Widget.md
### ----------------------------------------------------
### -- Chunk 3 of 4
-composited()`. On Windows it should work always, although setting a window’s opacity after the window has been shown causes it to flicker once on Windows.

For child widgets it doesn’t work if any affected widget has a native window, or disables double buffering.

    method set-opacity ( Num() $opacity )

  * Num() $opacity; desired opacity, between 0 and 1

set-realized
------------

Marks the widget as being realized. This function must only be called after all **Gnome::Gtk3::Windows** for the *widget* have been created and registered.

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

    method set-realized ( Bool $realized )

  * Bool $realized; `True` to mark the widget as realized

set-receives-default
--------------------

Specifies whether *widget* will be treated as the default widget within its toplevel when it has the focus, even if another widget is the default.

See `grab-default()` for details about the meaning of “default”.

    method set-receives-default ( Bool $receives_default )

  * Bool $receives_default; whether or not *widget* can be a default widget.

set-redraw-on-allocate
----------------------

Sets whether the entire widget is queued for drawing when its size allocation changes. By default, this setting is `True` and the entire widget is redrawn on every size change. If your widget leaves the upper left unchanged when made bigger, turning this setting off will improve performance. Note that for widgets where `get-has-window()` is `False` setting this flag to `False` turns off all allocation on resizing: the widget will not even redraw if its position changes; this is to allow containers that don’t draw anything to avoid excess invalidations. If you set this flag on a widget with no window that does draw on *widget*->window, you are responsible for invalidating both the old and new allocation of the widget when the widget is moved and responsible for invalidating regions newly when the widget increases size.

    method set-redraw-on-allocate ( Bool $redraw_on_allocate )

  * Bool $redraw_on_allocate; if `True`, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.

set-sensitive
-------------

Sets the sensitivity of a widget. A widget is sensitive if the user can interact with it. Insensitive widgets are “grayed out” and the user can’t interact with them. Insensitive widgets are known as “inactive”, “disabled”, or “ghosted” in some other toolkits.

    method set-sensitive ( Bool $sensitive )

  * Bool $sensitive; `True` to make the widget sensitive

set-size-request
----------------

Sets the minimum size of a widget; that is, the widget’s size request will be at least *width* by *height*. You can use this function to force a widget to be larger than it normally would be.

In most cases, `gtk-window-set-default-size()` is a better choice for toplevel windows than this function; setting the default size will still allow users to shrink the window. Setting the size request will force them to leave the window at least as large as the size request. When dealing with window sizes, `gtk-window-set-geometry-hints()` can be a useful function as well.

Note the inherent danger of setting any fixed size - themes, translations into other languages, different fonts, and user action can all change the appropriate size for a given widget. So, it's basically impossible to hardcode a size that will always be correct.

The size request of a widget is the smallest size a widget can accept while still functioning well and drawing itself correctly. However in some strange cases a widget may be allocated less than its requested size, and in many cases a widget may be allocated more space than it requested.

If the size request in a given direction is -1 (unset), then the “natural” size request of the widget will be used instead.

The size request set here does not include any margin from the **Gnome::Gtk3::Widget** properties margin-left, margin-right, margin-top, and margin-bottom, but it does include pretty much all other padding or border properties set by any subclass of **Gnome::Gtk3::Widget**.

    method set-size-request ( Int $width, Int $height )

  * Int $width; width *widget* should request, or -1 to unset

  * Int $height; height *widget* should request, or -1 to unset

set-state-flags
---------------

This function is for use in widget implementations. Turns on flag values in the current widget state (insensitive, prelighted, etc.).

This function accepts the values `GTK-STATE-FLAG-DIR-LTR` and `GTK-STATE-FLAG-DIR-RTL` but ignores them. If you want to set the widget's direction, use `set-direction()`.

It is worth mentioning that any other state than `GTK-STATE-FLAG-INSENSITIVE`, will be propagated down to all non-internal children if *widget* is a **Gnome::Gtk3::Container**, while `GTK-STATE-FLAG-INSENSITIVE` itself will be propagated down to all **Gnome::Gtk3::Container** children by different means than turning on the state flag down the hierarchy, both `get-state-flags()` and `is-sensitive()` will make use of these.

    method set-state-flags ( UInt $flags, Bool $clear )

  * UInt $flags; State flags to turn on. Flags are defined by GtkStateFlags.

  * Bool $clear; Whether to clear state before turning on *flags*

set-support-multidevice
-----------------------

Enables or disables multiple pointer awareness. If this setting is `True`, *widget* will start receiving multiple, per device enter/leave events. Note that if custom **Gnome::Gtk3::Windows** are created in a *realize* signal handler, `Gnome::Gdk3::Window.set-support-multidevice()` will have to be called manually on them.

    method set-support-multidevice ( Bool $support_multidevice )

  * Bool $support_multidevice; `True` to support input from multiple devices.

set-tooltip-markup
------------------

Sets *markup* as the contents of the tooltip, which is marked up with the [Pango text markup language][PangoMarkupFormat].

This function will take care of setting *has-tooltip* to `True` and of the default handler for the *query-tooltip* signal.

See also the *tooltip-markup* property and `gtk-tooltip-set-markup()`.

    method set-tooltip-markup ( Str $markup )

  * Str $markup; the contents of the tooltip for *widget*, or `undefined`

set-tooltip-text
----------------

Sets *text* as the contents of the tooltip. This function will take care of setting *has-tooltip* to `True` and of the default handler for the *query-tooltip* signal.

See also the *tooltip-text* property and `gtk-tooltip-set-text()`.

    method set-tooltip-text ( Str $text )

  * Str $text; the contents of the tooltip for *widget*

set-tooltip-window
------------------

Replaces the default window used for displaying tooltips with *custom-window*. GTK+ will take care of showing and hiding *custom-window* at the right moment, to behave likewise as the default tooltip window. If *custom-window* is `undefined`, the default tooltip window will be used.

    method set-tooltip-window ( N-GObject $custom_window )

  * N-GObject $custom_window; a **Gnome::Gtk3::Window**, or `undefined`

set-valign
----------

Sets the vertical alignment of *widget*. See the *valign* property.

    method set-valign ( GtkAlign $align )

  * GtkAlign $align; the vertical alignment

set-vexpand
-----------

Sets whether the widget would like any available extra vertical space.

See `set-hexpand()` for more detail.

    method set-vexpand ( Bool $expand )

  * Bool $expand; whether to expand

set-vexpand-set
---------------

Sets whether the vexpand flag (see `get-vexpand()`) will be used.

See `set-hexpand-set()` for more detail.

    method set-vexpand-set ( Bool $set )

  * Bool $set; value for vexpand-set property

set-visible
-----------

Sets the visibility state of *widget*. Note that setting this to `True` doesn’t mean the widget is actually viewable, see `get-visible()`.

This function simply calls `show()` or `hide()` but is nicer to use when the visibility of the widget depends on some condition.

    method set-visible ( Bool $visible )

  * Bool $visible; whether the widget should be shown or not

set-visual
----------

Sets the visual that should be used for by widget and its children for creating **Gnome::Gtk3::Windows**. The visual must be on the same **Gnome::Gdk3::Screen** as returned by `get-screen()`, so handling the *screen-changed* signal is necessary.

Setting a new *visual* will not cause *widget* to recreate its windows, so you should call this function before *widget* is realized.

    method set-visual ( N-GObject $visual )

  * N-GObject $visual; visual to be used or `undefined` to unset a previous one

set-window
----------

Sets a widget’s window. This function should only be used in a widget’s *realize* implementation. The `window` passed is usually either new window created with `gdk-window-new()`, or the window of its parent widget as returned by `get-parent-window()`.

Widgets must indicate whether they will create their own **Gnome::Gtk3::Window** by calling `set-has-window()`. This is usually done in the widget’s `init()` function.

Note that this function does not add any reference to *window*.

    method set-window ( N-GObject $window )

  * N-GObject $window; a **Gnome::Gtk3::Window**

show
----

Flags a widget to be displayed. Any widget that isn’t shown will not appear on the screen. If you want to show all the widgets in a container, it’s easier to call `show-all()` on the container, instead of individually showing the widgets.

Remember that you have to show the containers containing a widget, in addition to the widget itself, before it will appear onscreen.

When a toplevel container is shown, it is immediately realized and mapped; other shown widgets are realized and mapped when their toplevel container is realized and mapped.

    method show ( )

show-all
--------

Recursively shows a widget, and any child widgets (if the widget is a container).

    method show-all ( )

show-now
--------

Shows a widget. If the widget is an unmapped toplevel widget (i.e. a **Gnome::Gtk3::Window** that has not yet been shown), enter the main loop and wait for the window to actually be mapped. Be careful; because the main loop is running, anything can happen during this function.

    method show-now ( )

size-allocate
-------------

This function is only used by **Gnome::Gtk3::Container** subclasses, to assign a size and position to their child widgets.

In this function, the allocation may be adjusted. It will be forced to a 1x1 minimum size, and the adjust-size-allocation virtual method on the child will be used to adjust the allocation. Standard adjustments include removing the widget’s margins, and applying the widget’s *halign* and *valign* properties.

For baseline support in containers you need to use `size-allocate-with-baseline()` instead.

    method size-allocate ( N-GtkAllocation $allocation )

  * N-GtkAllocation $allocation; position and size to be allocated to *widget*

size-allocate-with-baseline
---------------------------

This function is only used by **Gnome::Gtk3::Container** subclasses, to assign a size, position and (optionally) baseline to their child widgets.

In this function, the allocation and baseline may be adjusted. It will be forced to a 1x1 minimum size, and the adjust-size-allocation virtual and adjust-baseline-allocation methods on the child will be used to adjust the allocation and baseline. Standard adjustments include removing the widget's margins, and applying the widget’s *halign* and *valign* properties.

If the child widget does not have a valign of `GTK-ALIGN-BASELINE` the baseline argument is ignored and -1 is used instead.

    method size-allocate-with-baseline ( N-GtkAllocation $allocation, Int $baseline )

  * N-GtkAllocation $allocation; position and size to be allocated to *widget*

  * Int $baseline; The baseline of the child, or -1

style-get-property
------------------

Gets the value of a style property of *widget*.

    method style-get-property ( Str $property_name, N-GObject $value )

  * Str $property_name; the name of a style property

  * N-GObject $value; location to return the property value

thaw-child-notify
-----------------

Reverts the effect of a previous call to `freeze-child-notify()`. This causes all queued *child-notify* signals on *widget* to be emitted.

    method thaw-child-notify ( )

translate-coordinates
---------------------

Translate coordinates relative to *src-widget*’s allocation to coordinates relative to *dest-widget*’s allocations. In order to perform this operation, both widgets must be realized, and must share a common toplevel.

    method translate-coordinates (
      N-GObject $dest_widget, Int $src_x, Int $src_y --> List
    )

  * N-GObject $dest_widget; a **Gnome::Gtk3::Widget**

  * Int $src_x; X position relative to *src-widget*

  * Int $src_y; Y position relative to *src-widget*

Returns a List which holds;

  * Bool result; <False> if either widget was not realized, or there was no common ancestor. In this case, the next values are undefined. Otherwise `True` and the next values are defined Int.

  * Int dest_x; X position relative to *$dest-widget*

  * Int dest_y; Y position relative to *$dest-widget*

trigger-tooltip-query
---------------------

Triggers a tooltip query on the display where the toplevel of *widget* is located. See `gtk-tooltip-trigger-tooltip-query()` for more information.

    method trigger-tooltip-query ( )

unmap
-----

This function is only for use in widget implementations. Causes a widget to be unmapped if it’s currently mapped.

    method unmap ( )

unparent
--------

This function is only for use in widget implementations. Should be called by implementations of the remove method on **Gnome::Gtk3::Container**, to dissociate a child from the container.

    method unparent ( )

unrealize
---------

This function is only useful in widget implementations. Causes a widget to be unrealized (frees all GDK resources associated with the widget, such as *widget*->window).

    method unrealize ( )

unregister-window
-----------------

Unregisters a **Gnome::Gtk3::Window** from the widget that was previously set up with `register-window()`. You need to call this when the window is no longer used by the widget, such as when you destroy it.

    method unregister-window ( N-GObject $window )

  * N-GObject $window; a **Gnome::Gtk3::Window**

unset-state-flags
-----------------

This function is for use in widget implementations. Turns off flag values for the current widget state (insensitive, prelighted, etc.). See `set-state-flags()`.

    method unset-state-flags ( UInt $flags )

  * UInt $flags; State flags to turn off. Flags are bits defined by GtkStateFlags

Signals
=======

There are two ways to connect to a signal. The first option you have is to use `register-signal()` from **Gnome::GObject::Object**. The second option is to use `connect-object()` directly from **Gnome::GObject::Signal**.

First method
------------

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

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

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

Second method
-------------

    my Gnome::Gtk3::Window $w .= new( … );
    my Callable $handler = sub (
      N-GObject $native, 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 `register-signal()` and `connect-object()` are using the signatures of the handler routines to setup the native call interface.

Supported signals
-----------------

### accel-closures-changed

    method handler (
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
      --> Int
    );

  * $widget; the object which received the signal.

  * $_handle_id; the registered event handler id

### button-press-event

The *button-press-event* signal will be emitted when a button (typically from a mouse) is pressed.

To receive this signal, the **Gnome::Gtk3::Window** associated to the widget needs to enable the `GDK-BUTTON-PRESS-MASK` mask.

This signal will be sent to the grab widget if there is one.

Returns: `True` to stop other handlers from being invoked for the event. `False` to propagate the event further.

    method handler (
      N-GdkEvent $event,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
      --> Int
    );

  * $widget; the object which received the signal.

  * $_handle_id; the registered event handler id

  * $event; (type N-GdkEventButton): the event which triggered this signal.

### button-release-event

The *button-release-event* signal will be emitted when a button (typically from a mouse) is released.

To receive this signal, the **Gnome::Gtk3::Window** associated to the widget needs to enable the `GDK-BUTTON-RELEASE-MASK` mask.

This signal will be sent to the grab widget if there is one.

Returns: `False` to stop other handlers from being invoked for the event. `True` to propagate the event further.

    method handler (
      N-GdkEvent $event,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
      --> Int
    );

  * $widget; the object which received the signal.

  * $_handle_id; the registered event handler id

  * $event; (type N-GdkEventButton): the event which triggered this signal.

### configure-event

The *configure-event* signal will be emitted when the size, position or stacking of the *widget*'s window has changed.

To receive this signal, the **Gnome::Gtk3::Window** associated to the widget needs to enable the `GDK-STRUCTURE-MASK` mask. GDK will enable this mask automatically for all new windows.

Returns: `True` to stop other handlers from being invoked for the event. `False` to propagate the event further.

    method handler (
      N-GdkEvent $event,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
      --> Int
    );

  * $widget; the object which received the signal

  * $_handle_id; the registered event handler id

  * $event; (type N-GdkEventConfigure): the event which triggered this signal.

### damage-event

Emitted when a redirected window belonging to *widget* gets drawn into. The region/area members of the event shows what area of the redirected drawable was drawn into.

Returns: `True` to stop other handlers from being invoked for the event. `False` to propagate the event further.

    method handler (
      N-GdkEvent $event,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
      --> Int
    );

  * $widget; the object which received the signal

  * $_handle_id; the registered event handler id

  * $event; (type N-GdkEventExpose): the event event

### delete-event

The *delete-event* signal is emitted if a user requests that a toplevel window is closed. The default handler for this signal destroys the window. Connecting `hide-on-delete()` to this signal will cause the window to be hidden instead, so that it can later be shown again without reconstructing it.

Returns: `True` to stop other handlers from being invoked for the event. `False` to propagate the event further.

    method handler (
      N-GdkEvent $event,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
      --> Int
    );

  * $widget; the object which received the signal

  * $_handle_id; the registered event handler id

  * $event; the event which triggered this signal

### destroy

Signals that all holders of a reference to the widget should release the reference that they hold. May result in finalization of the widget if all references are released.

This signal is not suitable for saving widget state.

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

  * $object; the object which received the signal

  * $_handle_id; the registered event handler id

### destroy-event

The *destroy-event* signal is emitted when a **Gnome::Gtk3::Window** is destroyed. You rarely get this signal, because most widgets disconnect themselves from their window before they destroy it, so no widget owns the window at destroy time.

To receive this signal, the **Gnome::Gtk3::Window** associated to the widget needs to enable the `GDK-STRUCTURE-MASK` mask. GDK will enable this mask automatically for all new windows.

Returns: `True` to stop other handlers from being invoked for the event. `False` to propagate the event further.

    method handler (
      N-GdkEvent $event,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
      --> Int
    );

  * $widget; the object which received the signal.

  * $_handle_id; the registered event handler id

  * $event; the event which triggered this signal

### direction-changed

The *direction-changed* signal is emitted when the text direction of a widget changes.

    method handler (
      GEnum $previous_direction,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
    );

  * $widget; the object on which the signal is emitted

  * $_handle_id; the registered event handler id

  * $previous_direction; the previous text direction of *widget* as a GTK_TYPE_TEXT_DIRECTION enum

### drag-begin

The *drag-begin* signal is emitted on the drag source when a drag is started. A typical reason to connect to this signal is to set up a custom drag icon with e.g. `gtk-drag-source-set-icon-pixbuf()`.

Note that some widgets set up a drag icon in the default handler of this signal, so you may have to use `g-signal-connect-after()` to override what the default handler did.

    method handler (
      N-GObject $context,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
      --> Int
    );

  * $widget; the object which received the signal

  * $_handle_id; the registered event handler id

  * $context; the drag context

### drag-data-delete

The *drag-data-delete* signal is emitted on the drag source when a drag with the action `GDK-ACTION-MOVE` is successfully completed. The signal handler is responsible for deleting the data that has been dropped. What "delete" means depends on the context of the drag operation.

    method handler (
      Unknown type GDK_TYPE_DRAG_CONTEXT $context,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
    );

  * $widget; the object which received the signal

  * $_handle_id; the registered event handler id

  * $context; the drag context

### drag-data-get

The *drag-data-get* signal is emitted on the drag source when the drop site requests the data which is dragged. It is the responsibility of the signal handler to fill *$data* with the data in the format which is indicated by *info*. See `gtk-selection-data-set()` and `gtk-selection-data-set-text()`.

    method handler (
      N-GObject $context,
      N-GObject $data,
      UInt $info,
      UInt $time,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
    );

  * $widget; the object which received the signal

  * $_handle_id; the registered event handler id

  * $context; the drag context, a native

  * $data; the native **Gnome::Gtk3::SelectionData** to be filled with the dragged data

  * $info; the info that has been registered with the target in the **Gnome::Gtk3::TargetList**

  * $time; the timestamp at which the data was requested

### drag-data-received

The *drag-data-received* signal is emitted on the drop site when the dragged data has been received. If the data was received in order to determine whether the drop will be accepted, the handler is expected to call `gdk-drag-status()` and not finish the drag. If the data was received in response to a *drag-drop* signal (and this is the last target to be received), the handler for this signal is expected to process the received data and then call `gtk-drag-finish()`, setting the *success* parameter depending on whether the data was processed successfully.

Applications must create some means to determine why the signal was emitted and therefore whether to call `gdk-drag-status()` or `gtk-drag-finish()`.

The handler method API:

    method handler (
      N-GObject $context,
      Int $x,
      Int $y,
      N-GObject $data,
      UInt $info,
      UInt $time,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
    );

  * $widget; the object which received the signal

  * $context; the drag context

  * $_handle_id; the registered event handler id

  * $x; where the drop happened

  * $y; where the drop happened

  * $data; the received data

  * $info; the info that has been registered with the target in the **Gnome::Gtk3::TargetList**

  * $time; the timestamp at which the data was received

### drag-drop

The *drag-drop* signal is emitted on the drop site when the user drops the data onto the widget. The signal handler must determine whether the cursor position is in a drop zone or not. If it is not in a drop zone, it returns `False` and no further processing is necessary. Otherwise, the handler returns `True`. In this case, the handler must ensure that `gtk-drag-finish()` is called to let the source know that the drop is done. The call to `gtk-drag-finish()` can be done either directly or in a *drag-data-received* handler which gets triggered by calling `gtk-drag-get-data()` to receive the data for one or more of the supported targets.

Returns: whether the cursor position is in a drop zone

    method handler (
      N-GObject $context,
      Int $x,
      Int $y,
      UInt $time,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
      --> Int
    );

  * $widget; the object which received the signal

  * $_handle_id; the registered event handler id

  * $context; the drag context

  * $x; the x coordinate of the current cursor position

  * $y; the y coordinate of the current cursor position

  * $time; the timestamp of the motion event

### drag-end

The *drag-end* signal is emitted on the drag source when a drag is finished. A typical reason to connect to this signal is to undo things done in *drag-begin*.

    method handler (
      N-GObject $context,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
    );

  * $widget; the object which received the signal

  * $_handle_id; the registered event handler id

  * $context; the drag context

### drag-failed

The *drag-failed* signal is emitted on the drag source when a drag has failed. The signal handler may hook custom code to handle a failed DnD operation based on the type of error, it returns `True` is the failure has been already handled (not showing the default "drag operation failed" animation), otherwise it returns `False`.

Returns: `True` if the failed drag operation has been already handled.

    method handler (
      N-GObject $context,
      Int $result,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
      --> Bool
    );

  * $widget; the object which received the signal

  * $_handle_id; the registered event handler id

  * $context; the drag context

  * $result; the result of the drag operation. a enum from GtkDragResult

### drag-leave

The *drag-leave* signal is emitted on the drop site when the cursor leaves the widget. A typical reason to connect to this signal is to undo things done in *drag-motion*, e.g. undo highlighting with `gtk-drag-unhighlight()`.

Likewise, the *drag-leave* signal is also emitted before the *drag-drop* signal, for instance to allow cleaning up of a preview item created in the *drag-motion* signal handler.

    method handler (
      N-GObject $context,
      UInt $time,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
    );

  * $widget; the object which received the signal.

  * $_handle_id; the registered event handler id

  * $context; the drag context

  * $time; the timestamp of the motion event

### drag-motion

The *drag-motion* signal is emitted on the drop site when the user moves the cursor over the widget during a drag. The signal handler must determine whether the cursor position is in a drop zone or not. If it is not in a drop zone, it returns `False` and no further processing is necessary. Otherwise, the handler returns `True`. In this case, the handler is responsible for providing the necessary information for displaying feedback to the user, by calling `gdk-drag-status()`.

If the decision whether the drop will be accepted or rejected can't be made based solely on the cursor position and the type of the data, the handler may inspect the dragged data by calling `gtk-drag-get-data()` and defer the `gdk-drag-status()` call to the *drag-data-received* handler. Note that you must pass `GTK-DEST-DEFAULT-DROP`, `GTK-DEST-DEFAULT-MOTION` or `GTK-DEST-DEFAULT-ALL` to `gtk-drag-dest-set()` when using the drag-motion signal that way.

Also note that there is no drag-enter signal. The drag receiver has to keep track of whether he has received any drag-motion signals since the last *drag-leave* and if not, treat the drag-motion signal as an "enter" signal. Upon an "enter", the handler will typically highlight the drop site with `gtk-drag-highlight()`.

Returns: whether the cursor position is in a drop zone

    method handler (
      N-GObject $context,
      Int $x,
      Int $y,
      Int $time,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
      --> Int
    );

  * $widget; the object which received the signal

  * $_handle_id; the registered event handler id

  * $context; the drag context

  * $x; the x coordinate of the current cursor position

  * $y; the y coordinate of the current cursor position

  * $time; the timestamp of the motion event

### draw

This signal is emitted when a widget is supposed to render itself. The *widget*'s top left corner must be painted at the origin of the passed in context and be sized to the values returned by `get-allocated-width()` and `get-allocated-height()`.

Signal handlers connected to this signal can modify the cairo context passed as *cr* in any way they like and don't need to restore it. The signal emission takes care of calling `cairo-save()` before and `cairo-restore()` after invoking the handler.

The signal handler will get a *cr* with a clip region already set to the widget's dirty region, i.e. to the area that needs repainting. Complicated widgets that want to avoid redrawing themselves completely can get the full extents of the clip region with `gdk-cairo-get-clip-rectangle()`, or they can get a finer-grained representation of the dirty region with `cairo-copy-clip-rectangle-list()`.

Returns: `True` to stop other handlers from being invoked for the event. `False` to propagate the event further.

    method handler (
      cairo_t $cr,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
      --> Int
    );

  * $widget; the object which received the signal

  * $_handle_id; the registered event handler id

  * $cr; the cairo context to draw to

### enter-notify-event

The *enter-notify-event* will be emitted when the pointer enters the *widget*'s window.

To receive this signal, the **Gnome::Gtk3::Window** associated to the widget needs to enable the `GDK-ENTER-NOTIFY-MASK` mask.

This signal will be sent to the grab widget if there is one.

Returns: `True` to stop other handlers from being invoked for the event. `False` to propagate the event further.

    method handler (
      N-GdkEvent $event,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
      --> Int
    );

  * $widget; the object which received the signal

  * $_handle_id; the registered event handler id

  * $event; (type N-GdkEventCrossing): the event which triggered this signal.

### event

The GTK+ main loop will emit three signals for each GDK event delivered to a widget: one generic *event* signal, another, more specific, signal that matches the type of event delivered (e.g. *key-press-event*) and finally a generic *event-after* signal.

Returns: `True` to stop other handlers from being invoked for the event and to cancel the emission of the second specific *event* signal. `False` to propagate the event further and to allow the emission of the second signal. The *event-after* signal is emitted regardless of the return value.

    method handler (
      N-GdkEvent $event,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
      --> Int
    );

  * $widget; the object which received the signal.

  * $_handle_id; the registered event handler id

  * $event; the **Gnome::Gtk3::Event** which triggered this signal

### event-after

After the emission of the *event* signal and (optionally) the second more specific signal, *event-after* will be emitted regardless of the previous two signals handlers return values.

    method handler (
      N-GdkEvent $event,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
    );

  * $widget; the object which received the signal.

  * $_handle_id; the registered event handler id

  * $event; the **Gnome::Gtk3::Event** which triggered this signal

### focus

Returns: `True` to stop other handlers from being invoked for the event. `False` to propagate the event further.

    method handler (
      Int $direction,
      Int :$_handle_id,
      Gnome::GObject::Object :_widget($widget),
      *%user-options
      --> Int
    );

  * $widget; the object which received the signal.

  * $_handle_id; the registered event handler id

  * $direction; it is an enumeration `GtkDirectionType`.

### focus-in-event

The *focus-in-event* signal will be emitted when the keyboard focus enters the *widget*'s window.

To receive this signal, the **Gnome::Gtk3::Window** associated to the widget needs to enable the `GDK-FOCUS-CHANGE-MASK` mask.

Returns: `True` to stop other handlers from being invoked for the event