GimpUi.widget_set_native_handle
Description: Reference for GimpUi.widget_set_native_handle

### Function

# GimpUiwidget_set_native_handle

since: 3.0

#### Declaration [src]

    void
    gimp_widget_set_native_handle (
      GtkWidget* widget,
      GBytes** window_handle
    )

#### Description [src]

This function is to be used in custom widget construction to store the window handle representing `widget` into `window_handle` so that it can later be reused to set other windows as transient to this one (even across processes, such as in-between plug-ins), e.g. using `gimp_window_set_transient_for()`.

Depending on the platform, the actual content of `window_handle` can be various types and should therefore be considered an opaque data. Moreover it may be filled asynchronously in a callback, so you should not assume that `window_handle` is set after running this function.

This convenience function is safe to use even before `widget` is visible as it will set the handle once it is mapped.

Free `window_handle` on `dispose()` or `finalize()` with `gimp_widget_free_native_handle()`.

Available since: 3.0

#### Parameters

`widget`

  Type: `GtkWidget`

  A widget to get a handle for.

  The data is owned by the caller of the function.

`window_handle`

  Type: `GBytes`

  Pointer to store the native handle as a `GBytes`.

  The argument will be modified by the function.
  The caller of the function takes ownership of the returned data, and is responsible for freeing it.