## GimpQueryBox

GimpQueryBox — Some simple dialogs to enter a single int, double, string or boolean value.

## Synopsis

    void                (*GimpQueryStringCallback)          (GtkWidget *query_box,
                                                             const gchar *string,
                                                             gpointer data);
    void                (*GimpQueryIntCallback)             (GtkWidget *query_box,
                                                             gint value,
                                                             gpointer data);
    void                (*GimpQueryDoubleCallback)          (GtkWidget *query_box,
                                                             gdouble value,
                                                             gpointer data);
    void                (*GimpQuerySizeCallback)            (GtkWidget *query_box,
                                                             gdouble size,
                                                             GimpUnit unit,
                                                             gpointer data);
    void                (*GimpQueryBooleanCallback)         (GtkWidget *query_box,
                                                             gboolean value,
                                                             gpointer data);
    GtkWidget *         gimp_query_string_box               (const gchar *title,
                                                             GtkWidget *parent,
                                                             GimpHelpFunc help_func,
                                                             const gchar *help_id,
                                                             const gchar *message,
                                                             const gchar *initial,
                                                             GObject *object,
                                                             const gchar *signal,
                                                             GimpQueryStringCallback callback,
                                                             gpointer data);
    GtkWidget *         gimp_query_int_box                  (const gchar *title,
                                                             GtkWidget *parent,
                                                             GimpHelpFunc help_func,
                                                             const gchar *help_id,
                                                             const gchar *message,
                                                             gint initial,
                                                             gint lower,
                                                             gint upper,
                                                             GObject *object,
                                                             const gchar *signal,
                                                             GimpQueryIntCallback callback,
                                                             gpointer data);
    GtkWidget *         gimp_query_double_box               (const gchar *title,
                                                             GtkWidget *parent,
                                                             GimpHelpFunc help_func,
                                                             const gchar *help_id,
                                                             const gchar *message,
                                                             gdouble initial,
                                                             gdouble lower,
                                                             gdouble upper,
                                                             gint digits,
                                                             GObject *object,
                                                             const gchar *signal,
                                                             GimpQueryDoubleCallback callback,
                                                             gpointer data);
    GtkWidget *         gimp_query_size_box                 (const gchar *title,
                                                             GtkWidget *parent,
                                                             GimpHelpFunc help_func,
                                                             const gchar *help_id,
                                                             const gchar *message,
                                                             gdouble initial,
                                                             gdouble lower,
                                                             gdouble upper,
                                                             gint digits,
                                                             GimpUnit unit,
                                                             gdouble resolution,
                                                             gboolean dot_for_dot,
                                                             GObject *object,
                                                             const gchar *signal,
                                                             GimpQuerySizeCallback callback,
                                                             gpointer data);
    GtkWidget *         gimp_query_boolean_box              (const gchar *title,
                                                             GtkWidget *parent,
                                                             GimpHelpFunc help_func,
                                                             const gchar *help_id,
                                                             const gchar *stock_id,
                                                             const gchar *message,
                                                             const gchar *true_button,
                                                             const gchar *false_button,
                                                             GObject *object,
                                                             const gchar *signal,
                                                             GimpQueryBooleanCallback callback,
                                                             gpointer data);
    #define             GIMP_QUERY_BOX_VBOX                 (qbox)

## Description

These functions provide simple dialogs for entering a single string, integer, double, boolean or pixel size value.

They return a pointer to a GtkDialog which has to be shown with `gtk_widget_show()` by the caller.

The dialogs contain an entry widget for the kind of value they ask for and "OK" and "Cancel" buttons. On "Cancel", all query boxes except the boolean one silently destroy themselves. On "OK" the user defined callback function is called and returns the entered value.

## Details

### GimpQueryStringCallback ()

    void                (*GimpQueryStringCallback)          (GtkWidget *query_box,
                                                             const gchar *string,
                                                             gpointer data);

Note that you have to `g_free()` the returned string.

`query_box` : | The query box.
`string` : | The entered string.
`data` : | The user data.

### GimpQueryIntCallback ()

    void                (*GimpQueryIntCallback)             (GtkWidget *query_box,
                                                             gint value,
                                                             gpointer data);

`query_box` : | The query box.
`value` : | The entered integer value.
`data` : | The user data.

### GimpQueryDoubleCallback ()

    void                (*GimpQueryDoubleCallback)          (GtkWidget *query_box,
                                                             gdouble value,
                                                             gpointer data);

`query_box` : | The query box.
`value` : | The entered double value.
`data` : | The user data.

### GimpQuerySizeCallback ()

    void                (*GimpQuerySizeCallback)            (GtkWidget *query_box,
                                                             gdouble size,
                                                             GimpUnit unit,
                                                             gpointer data);

`query_box` : | The query box.
`size` : | The entered size in pixels.
`unit` : | The selected unit from the GimpUnitMenu.
`data` : | The user data.

### GimpQueryBooleanCallback ()

    void                (*GimpQueryBooleanCallback)         (GtkWidget *query_box,
                                                             gboolean value,
                                                             gpointer data);

`query_box` : | The query box.
`value` : | The entered boolean value.
`data` : | The user data.

### gimp_query_string_box ()

    GtkWidget *         gimp_query_string_box               (const gchar *title,
                                                             GtkWidget *parent,
                                                             GimpHelpFunc help_func,
                                                             const gchar *help_id,
                                                             const gchar *message,
                                                             const gchar *initial,
                                                             GObject *object,
                                                             const gchar *signal,
                                                             GimpQueryStringCallback callback,
                                                             gpointer data);

Creates a new GtkDialog that queries the user for a string value.

`title` : | The query box dialog's title.
`parent` : | The dialog's parent widget.
`help_func` : | The help function to show this dialog's help page.
`help_id` : | A string identifying this dialog's help page.
`message` : | A string which will be shown above the dialog's entry widget.
`initial` : | The initial value.
`object` : | The object this query box is associated with.
`signal` : | The object's signal which will cause the query box to be closed.
`callback` : | The function which will be called when the user selects "OK".
`data` : | The callback's user data.
Returns : | A pointer to the new GtkDialog.

### gimp_query_int_box ()

    GtkWidget *         gimp_query_int_box                  (const gchar *title,
                                                             GtkWidget *parent,
                                                             GimpHelpFunc help_func,
                                                             const gchar *help_id,
                                                             const gchar *message,
                                                             gint initial,
                                                             gint lower,
                                                             gint upper,
                                                             GObject *object,
                                                             const gchar *signal,
                                                             GimpQueryIntCallback callback,
                                                             gpointer data);

Creates a new GtkDialog that queries the user for an integer value.

`title` : | The query box dialog's title.
`parent` : | The dialog's parent widget.
`help_func` : | The help function to show this dialog's help page.
`help_id` : | A string identifying this dialog's help page.
`message` : | A string which will be shown above the dialog's entry widget.
`initial` : | The initial value.
`lower` : | The lower boundary of the range of possible values.
`upper` : | The upper boundray of the range of possible values.
`object` : | The object this query box is associated with.
`signal` : | The object's signal which will cause the query box to be closed.
`callback` : | The function which will be called when the user selects "OK".
`data` : | The callback's user data.
Returns : | A pointer to the new GtkDialog.

### gimp_query_double_box ()

    GtkWidget *         gimp_query_double_box               (const gchar *title,
                                                             GtkWidget *parent,
                                                             GimpHelpFunc help_func,
                                                             const gchar *help_id,
                                                             const gchar *message,
                                                             gdouble initial,
                                                             gdouble lower,
                                                             gdouble upper,
                                                             gint digits,
                                                             GObject *object,
                                                             const gchar *signal,
                                                             GimpQueryDoubleCallback callback,
                                                             gpointer data);

Creates a new GtkDialog that queries the user for a double value.

`title` : | The query box dialog's title.
`parent` : | The dialog's parent widget.
`help_func` : | The help function to show this dialog's help page.
`help_id` : | A string identifying this dialog's help page.
`message` : | A string which will be shown above the dialog's entry widget.
`initial` : | The initial value.
`lower` : | The lower boundary of the range of possible values.
`upper` : | The upper boundray of the range of possible values.
`digits` : | The number of decimal digits the GtkSpinButton will provide.
`object` : | The object this query box is associated with.
`signal` : | The object's signal which will cause the query box to be closed.
`callback` : | The function which will be called when the user selects "OK".
`data` : | The callback's user data.
Returns : | A pointer to the new GtkDialog.

### gimp_query_size_box ()

    GtkWidget *         gimp_query_size_box                 (const gchar *title,
                                                             GtkWidget *parent,
                                                             GimpHelpFunc help_func,
                                                             const gchar *help_id,
                                                             const gchar *message,
                                                             gdouble initial,
                                                             gdouble lower,
                                                             gdouble upper,
                                                             gint digits,
                                                             GimpUnit unit,
                                                             gdouble resolution,
                                                             gboolean dot_for_dot,
                                                             GObject *object,
                                                             const gchar *signal,
                                                             GimpQuerySizeCallback callback,
                                                             gpointer data);

Creates a new GtkDialog that queries the user for a size using a GimpSizeEntry.

`title` : | The query box dialog's title.
`parent` : | The dialog's parent widget.
`help_func` : | The help function to show this dialog's help page.
`help_id` : | A string identifying this dialog's help page.
`message` : | A string which will be shown above the dialog's entry widget.
`initial` : | The initial value.
`lower` : | The lower boundary of the range of possible values.
`upper` : | The upper boundray of the range of possible values.
`digits` : | The number of decimal digits the GimpSizeEntry provide in "pixel" mode.
`unit` : | The unit initially shown by the GimpUnitMenu.
`resolution` : | The resolution (in dpi) which will be used for pixel/unit calculations.
`dot_for_dot` : | `TRUE` if the GimpUnitMenu's initial unit should be "pixels".
`object` : | The object this query box is associated with.
`signal` : | The object's signal which will cause the query box to be closed.
`callback` : | The function which will be called when the user selects "OK".
`data` : | The callback's user data.
Returns : | A pointer to the new GtkDialog.

### gimp_query_boolean_box ()

    GtkWidget *         gimp_query_boolean_box              (const gchar *title,
                                                             GtkWidget *parent,
                                                             GimpHelpFunc help_func,
                                                             const gchar *help_id,
                                                             const gchar *stock_id,
                                                             const gchar *message,
                                                             const gchar *true_button,
                                                             const gchar *false_button,
                                                             GObject *object,
                                                             const gchar *signal,
                                                             GimpQueryBooleanCallback callback,
                                                             gpointer data);

Creates a new GtkDialog that asks the user to do a boolean decision.

`title` : | The query box dialog's title.
`parent` : | The dialog's parent widget.
`help_func` : | The help function to show this dialog's help page.
`help_id` : | A string identifying this dialog's help page.
`stock_id` : | A stock_id to specify an icon to appear on the left on the dialog's message.
`message` : | A string which will be shown in the query box.
`true_button` : | The string to be shown in the dialog's left button.
`false_button` : | The string to be shown in the dialog's right button.
`object` : | The object this query box is associated with.
`signal` : | The object's signal which will cause the query box to be closed.
`callback` : | The function which will be called when the user clicks one of the buttons.
`data` : | The callback's user data.
Returns : | A pointer to the new GtkDialog.

### GIMP_QUERY_BOX_VBOX()

    #define             GIMP_QUERY_BOX_VBOX(qbox)

A macro to access the GtkVBox in a GimpQueryBox. Useful if you want to add more widgets.

`qbox` : |

## See Also

GimpSizeEntry

GimpUnitMenu