GIMP Library Reference Manual: gimpui

## gimpui gimpui — Common user interface functions. This header includes all other GIMP User Interface Library headers. |

## Functions

void | gimp_ui_init ()
GdkWindow * | gimp_ui_get_display_window ()
GdkWindow * | gimp_ui_get_progress_window ()
void | gimp_window_set_transient ()
void | gimp_window_set_transient_for_display ()

## Description

Common user interface functions. This header includes all other GIMP User Interface Library headers.

## Functions

### gimp_ui_init ()

    void
    gimp_ui_init (const gchar *prog_name,
                  gboolean preview);

This function initializes GTK+ with `gtk_init()` and initializes GDK's image rendering subsystem (GdkRGB) to follow the GIMP main program's colormap allocation/installation policy.

It also sets up various other things so that the plug-in user looks and behaves like the GIMP core. This includes selecting the GTK+ theme and setting up the help system as chosen in the GIMP preferences. Any plug-in that provides a user interface should call this function.

#### Parameters

prog_name | The name of the plug-in which will be passed as argv[0] to `gtk_init()`. It's a convention to use the name of the executable and _not_ the PDB procedure name. |
preview | This parameter is unused and exists for historical reasons only. |

### gimp_ui_get_display_window ()

    GdkWindow *
    gimp_ui_get_display_window (guint32 gdisp_ID);

Returns the GdkWindow of a display window. The purpose is to allow to make plug-in dialogs transient to the image display as explained with `gdk_window_set_transient_for()`.

You shouldn't have to call this function directly. Use `gimp_window_set_transient_for_display()` instead.

#### Parameters

gdisp_ID | a GimpDisplay ID. |

#### Returns

A reference to a GdkWindow or `NULL`. You should unref the window using `g_object_unref()` as soon as you don't need it any longer.

Since GIMP 2.4

### gimp_ui_get_progress_window ()

    GdkWindow *
    gimp_ui_get_progress_window (void);

Returns the GdkWindow of the window this plug-in's progress bar is shown in. Use it to make plug-in dialogs transient to this window as explained with `gdk_window_set_transient_for()`.

You shouldn't have to call this function directly. Use `gimp_window_set_transient()` instead.

#### Returns

A reference to a GdkWindow or `NULL`. You should unref the window using `g_object_unref()` as soon as you don't need it any longer.

Since GIMP 2.4

### gimp_window_set_transient ()

    void
    gimp_window_set_transient (GtkWindow *window);

Indicates to the window manager that `window` is a transient dialog associated with the GIMP window that the plug-in has been started from. See also `gimp_window_set_transient_for_display()`.

#### Parameters

window | the GtkWindow that should become transient |

Since GIMP 2.4

### gimp_window_set_transient_for_display ()

    void
    gimp_window_set_transient_for_display (GtkWindow *window,
                                           guint32 gdisp_ID);

Indicates to the window manager that `window` is a transient dialog associated with the GIMP image window that is identified by it's display ID. See `gdk_window_set_transient_for()` for more information.

Most of the time you will want to use the convenience function `gimp_window_set_transient()`.

#### Parameters

window | the GtkWindow that should become transient |
gdisp_ID | display ID of the image window that should become the parent |

Since GIMP 2.4

## Types and Values

## See Also

gtk_init(), `gdk_set_use_xshm()`, `gdk_rgb_get_visual()`, `gdk_rgb_get_cmap()`, `gtk_widget_set_default_visual()`, `gtk_widget_set_default_colormap()`, `gtk_preview_set_gamma()`.