Commit 68dfb3f2 authored by Manish Singh's avatar Manish Singh Committed by Manish Singh

libgimp/gimpuitypes.h abstract class for resource selection buttons.

2006-06-25  Manish Singh  <yosh@gimp.org>

        * libgimp/gimpuitypes.h
        * libgimp/gimpselectbutton.[ch]: abstract class for resource selection
        buttons.

        * libgimp/gimpfontselectbutton.[ch]: derive from GimpSelectButton.

        * libgimp/gimpbrushselectbutton.[ch]
        * libgimp/gimpgradientselectbutton.[ch]
        * libgimp/gimppaletteselectbutton.[ch]
        * libgimp/gimppatternselectbutton.[ch]: replacements for
        gimp_foo_select widgets, akin to GimpFontSelectButton.

        * libgimp/gimpbrushmenu.[ch]
        * libgimp/gimpgradientmenu.[ch]
        * libgimp/gimppalettemenu.[ch]
        * libgimp/gimppatternmenu.[ch]: deprecate old API, and reimplement
        in terms of GimpFooSelectButton.

        * libgimp/gimpfontmenu.[ch]: change to use the GimpSelectButton API.

        * libgimp/gimpuimarshal.list: new marshallers for the above new
        widgets.

        * libgimp/gimpui.h: add new headers.

        * libgimp/Makefile.am: add new files.

        * plug-ins/FractalExplorer/Dialogs.c
        * plug-ins/gfig/gfig-dialog.c
        * plug-ins/gfig/gfig-style.[ch]
        * plug-ins/script-fu/script-fu-interface.c: use new API.
parent b39f3ce1
2006-06-25 Manish Singh <yosh@gimp.org>
* libgimp/gimpuitypes.h
* libgimp/gimpselectbutton.[ch]: abstract class for resource selection
buttons.
* libgimp/gimpfontselectbutton.[ch]: derive from GimpSelectButton.
* libgimp/gimpbrushselectbutton.[ch]
* libgimp/gimpgradientselectbutton.[ch]
* libgimp/gimppaletteselectbutton.[ch]
* libgimp/gimppatternselectbutton.[ch]: replacements for
gimp_foo_select widgets, akin to GimpFontSelectButton.
* libgimp/gimpbrushmenu.[ch]
* libgimp/gimpgradientmenu.[ch]
* libgimp/gimppalettemenu.[ch]
* libgimp/gimppatternmenu.[ch]: deprecate old API, and reimplement
in terms of GimpFooSelectButton.
* libgimp/gimpfontmenu.[ch]: change to use the GimpSelectButton API.
* libgimp/gimpuimarshal.list: new marshallers for the above new
widgets.
* libgimp/gimpui.h: add new headers.
* libgimp/Makefile.am: add new files.
* plug-ins/FractalExplorer/Dialogs.c
* plug-ins/gfig/gfig-dialog.c
* plug-ins/gfig/gfig-style.[ch]
* plug-ins/script-fu/script-fu-interface.c: use new API.
2006-06-25 Manish Singh <yosh@gimp.org>
* libgimp/gimpbrushes.c
......
......@@ -234,42 +234,52 @@ libgimp_2_0_la_SOURCES = \
$(libgimp_2_0_la_sources)
libgimpui_2_0_la_sources = \
gimpui.c \
gimpui.h \
gimpuitypes.h \
gimpaspectpreview.c \
gimpaspectpreview.h \
gimpbrushmenu.c \
gimpbrushmenu.h \
gimpdrawablecombobox.c \
gimpdrawablecombobox.h \
gimpdrawablepreview.c \
gimpdrawablepreview.h \
gimpexport.c \
gimpexport.h \
gimpfontmenu.c \
gimpfontmenu.h \
gimpfontselectbutton.c \
gimpfontselectbutton.h \
gimpgradientmenu.c \
gimpgradientmenu.h \
gimpimagecombobox.c \
gimpimagecombobox.h \
gimpmenu.c \
gimpmenu.h \
gimppalettemenu.c \
gimppalettemenu.h \
gimppatternmenu.c \
gimppatternmenu.h \
gimppixbuf.c \
gimppixbuf.h \
gimpprocbrowserdialog.c \
gimpprocbrowserdialog.h \
gimpprocview.c \
gimpprocview.h \
gimpprogressbar.c \
gimpprogressbar.h \
gimpzoompreview.c \
gimpui.c \
gimpui.h \
gimpuitypes.h \
gimpaspectpreview.c \
gimpaspectpreview.h \
gimpbrushmenu.c \
gimpbrushmenu.h \
gimpbrushselectbutton.c \
gimpbrushselectbutton.h \
gimpdrawablecombobox.c \
gimpdrawablecombobox.h \
gimpdrawablepreview.c \
gimpdrawablepreview.h \
gimpexport.c \
gimpexport.h \
gimpfontmenu.c \
gimpfontmenu.h \
gimpfontselectbutton.c \
gimpfontselectbutton.h \
gimpgradientmenu.c \
gimpgradientmenu.h \
gimpgradientselectbutton.c \
gimpgradientselectbutton.h \
gimpimagecombobox.c \
gimpimagecombobox.h \
gimpmenu.c \
gimpmenu.h \
gimppalettemenu.c \
gimppalettemenu.h \
gimppaletteselectbutton.c \
gimppaletteselectbutton.h \
gimppatternmenu.c \
gimppatternmenu.h \
gimppatternselectbutton.c \
gimppatternselectbutton.h \
gimppixbuf.c \
gimppixbuf.h \
gimpprocbrowserdialog.c \
gimpprocbrowserdialog.h \
gimpprocview.c \
gimpprocview.h \
gimpprogressbar.c \
gimpprogressbar.h \
gimpselectbutton.c \
gimpselectbutton.h \
gimpzoompreview.c \
gimpzoompreview.h
libgimpui_2_0_la_built_sources = \
......@@ -283,53 +293,58 @@ libgimpui_2_0_la_SOURCES = \
$(libgimpui_2_0_la_sources)
gimpinclude_HEADERS = \
gimp.h \
gimpcompat.h \
gimptypes.h \
gimpenums.h \
${PDB_WRAPPERS_H} \
gimpbrushes.h \
gimpbrushselect.h \
gimpchannel.h \
gimpdrawable.h \
gimpfontselect.h \
gimpgimprc.h \
gimpgradients.h \
gimpgradientselect.h \
gimpimage.h \
gimplayer.h \
gimppalette.h \
gimppalettes.h \
gimppaletteselect.h \
gimppatterns.h \
gimppatternselect.h \
gimppixelfetcher.h \
gimppixelrgn.h \
gimpplugin.h \
gimpproceduraldb.h \
gimpprogress.h \
gimpregioniterator.h \
gimpselection.h \
gimptile.h \
gimp.h \
gimpcompat.h \
gimptypes.h \
gimpenums.h \
${PDB_WRAPPERS_H} \
gimpbrushes.h \
gimpbrushselect.h \
gimpchannel.h \
gimpdrawable.h \
gimpfontselect.h \
gimpgimprc.h \
gimpgradients.h \
gimpgradientselect.h \
gimpimage.h \
gimplayer.h \
gimppalette.h \
gimppalettes.h \
gimppaletteselect.h \
gimppatterns.h \
gimppatternselect.h \
gimppixelfetcher.h \
gimppixelrgn.h \
gimpplugin.h \
gimpproceduraldb.h \
gimpprogress.h \
gimpregioniterator.h \
gimpselection.h \
gimptile.h \
\
gimpui.h \
gimpuitypes.h \
gimpaspectpreview.h \
gimpbrushmenu.h \
gimpdrawablecombobox.h \
gimpdrawablepreview.h \
gimpexport.h \
gimpfontmenu.h \
gimpfontselectbutton.h \
gimpgradientmenu.h \
gimpimagecombobox.h \
gimpmenu.h \
gimppalettemenu.h \
gimppatternmenu.h \
gimppixbuf.h \
gimpprocbrowserdialog.h \
gimpprocview.h \
gimpprogressbar.h \
gimpui.h \
gimpuitypes.h \
gimpaspectpreview.h \
gimpbrushmenu.h \
gimpbrushselectbutton.h \
gimpdrawablecombobox.h \
gimpdrawablepreview.h \
gimpexport.h \
gimpfontmenu.h \
gimpfontselectbutton.h \
gimpgradientmenu.h \
gimpgradientselectbutton.h \
gimpimagecombobox.h \
gimpmenu.h \
gimppalettemenu.h \
gimppaletteselectbutton.h \
gimppatternmenu.h \
gimppatternselectbutton.h \
gimppixbuf.h \
gimpprocbrowserdialog.h \
gimpprocview.h \
gimpprogressbar.h \
gimpselectbutton.h \
gimpzoompreview.h
libgimp_2_0_la_LDFLAGS = \
......
This diff is collapsed.
......@@ -22,6 +22,12 @@
#ifndef __GIMP_BRUSH_MENU_H__
#define __GIMP_BRUSH_MENU_H__
/* These functions are deprecated and should not be used in newly
* written code.
*/
#ifndef GIMP_DISABLE_DEPRECATED
G_BEGIN_DECLS
......@@ -43,4 +49,6 @@ void gimp_brush_select_widget_set (GtkWidget *widget,
G_END_DECLS
#endif /* GIMP_DISABLE_DEPRECATED */
#endif /* __GIMP_BRUSH_MENU_H__ */
This diff is collapsed.
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpbrushselectbutton.h
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_BRUSH_SELECT_BUTTON_H__
#define __GIMP_BRUSH_SELECT_BUTTON_H__
#include <libgimp/gimpselectbutton.h>
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#define GIMP_TYPE_BRUSH_SELECT_BUTTON (gimp_brush_select_button_get_type ())
#define GIMP_BRUSH_SELECT_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_BRUSH_SELECT_BUTTON, GimpBrushSelectButton))
#define GIMP_BRUSH_SELECT_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_BRUSH_SELECT_BUTTON, GimpBrushSelectButtonClass))
#define GIMP_IS_BRUSH_SELECT_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_BRUSH_SELECT_BUTTON))
#define GIMP_IS_BRUSH_SELECT_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_BRUSH_SELECT_BUTTON))
#define GIMP_BRUSH_SELECT_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_BRUSH_SELECT_BUTTON, GimpBrushSelectButtonClass))
typedef struct _GimpBrushSelectButtonClass GimpBrushSelectButtonClass;
struct _GimpBrushSelectButton
{
GimpSelectButton parent_instance;
};
struct _GimpBrushSelectButtonClass
{
GimpSelectButtonClass parent_class;
/* brush_set signal is emitted when brush is chosen */
void (* brush_set) (GimpBrushSelectButton *brush_button,
const gchar *brush_name,
gdouble opacity,
gint spacing,
GimpLayerModeEffects paint_mode,
gint width,
gint height,
const guchar *mask_data,
gboolean dialog_closing);
/* Padding for future expansion */
void (*_gimp_reserved1) (void);
void (*_gimp_reserved2) (void);
void (*_gimp_reserved3) (void);
void (*_gimp_reserved4) (void);
};
GType gimp_brush_select_button_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_brush_select_button_new (const gchar *title,
const gchar *brush_name,
gdouble opacity,
gint spacing,
GimpLayerModeEffects paint_mode);
G_CONST_RETURN gchar * gimp_brush_select_button_get_brush (GimpBrushSelectButton *button,
gdouble *opacity,
gint *spacing,
GimpLayerModeEffects *paint_mode);
void gimp_brush_select_button_set_brush (GimpBrushSelectButton *button,
const gchar *brush_name,
gdouble opacity,
gint spacing,
GimpLayerModeEffects paint_mode);
G_END_DECLS
#endif /* __GIMP_BRUSH_SELECT_BUTTON_H__ */
......@@ -23,7 +23,12 @@
#include "config.h"
#include "gimp.h"
#include "gimpui.h"
#include "gimpuitypes.h"
#include "gimpfontselectbutton.h"
#undef GIMP_DISABLE_DEPRECATED
#include "gimpfontmenu.h"
typedef struct _CompatCallbackData CompatCallbackData;
......@@ -43,8 +48,7 @@ static void compat_callback (GimpFontSelectButton *font_button,
/**
* gimp_font_select_widget_new:
* @title: Title of the dialog to use or %NULL means to use the default
* title.
* @title: Title of the dialog to use or %NULL to use the default title.
* @font_name: Initial font name.
* @callback: A function to call when the selected font changes.
* @data: A pointer to arbitary data to be used in the call to @callback.
......@@ -90,7 +94,7 @@ gimp_font_select_widget_close (GtkWidget *widget)
{
g_return_if_fail (widget != NULL);
gimp_font_select_button_close_popup (GIMP_FONT_SELECT_BUTTON (widget));
gimp_select_button_close_popup (GIMP_SELECT_BUTTON (widget));
}
/**
......
This diff is collapsed.
......@@ -22,6 +22,8 @@
#ifndef __GIMP_FONT_SELECT_BUTTON_H__
#define __GIMP_FONT_SELECT_BUTTON_H__
#include <libgimp/gimpselectbutton.h>
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
......@@ -39,15 +41,12 @@ typedef struct _GimpFontSelectButtonClass GimpFontSelectButtonClass;
struct _GimpFontSelectButton
{
GtkButton parent_instance;
/*< private >*/
gpointer priv;
GimpSelectButton parent_instance;
};
struct _GimpFontSelectButtonClass
{
GtkButtonClass parent_class;
GimpSelectButtonClass parent_class;
/* font_set signal is emitted when font is chosen */
void (* font_set) (GimpFontSelectButton *font_button,
......@@ -64,14 +63,14 @@ struct _GimpFontSelectButtonClass
GType gimp_font_select_button_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_font_select_button_new (const gchar *title,
const gchar *font_name);
GtkWidget * gimp_font_select_button_new (const gchar *title,
const gchar *font_name);
void gimp_font_select_button_close_popup (GimpFontSelectButton *button);
G_CONST_RETURN gchar * gimp_font_select_button_get_font_name (GimpFontSelectButton *button);
void gimp_font_select_button_set_font_name (GimpFontSelectButton *button,
const gchar *font_name);
G_CONST_RETURN gchar * gimp_font_select_button_get_font_name
(GimpFontSelectButton *button);
void gimp_font_select_button_set_font_name
(GimpFontSelectButton *button,
const gchar *font_name);
G_END_DECLS
......
......@@ -22,84 +22,46 @@
#include "config.h"
#include <string.h>
#include "gimp.h"
#include "gimpui.h"
#include "libgimp-intl.h"
#include "gimpuitypes.h"
#include "gimpgradientselectbutton.h"
#define GRADIENT_SELECT_DATA_KEY "gimp-gradient-select-data"
#define CELL_HEIGHT 18
#define CELL_WIDTH 84
#undef GIMP_DISABLE_DEPRECATED
#include "gimpgradientmenu.h"
typedef struct _GradientSelect GradientSelect;
typedef struct _CompatCallbackData CompatCallbackData;
struct _GradientSelect
struct _CompatCallbackData
{
gchar *title;
GimpRunGradientCallback callback;
gpointer data;
GtkWidget *preview;
GtkWidget *button;
gchar *gradient_name; /* Local copy */
gint sample_size;
gboolean reverse;
gint n_samples;
gdouble *gradient_data; /* Local copy */
const gchar *temp_gradient_callback;
GimpRunGradientCallback callback;
gpointer data;
};
/* local function prototypes */
static void gimp_gradient_select_widget_callback (const gchar *name,
gint n_samples,
const gdouble *gradient_data,
gboolean closing,
gpointer data);
static void gimp_gradient_select_widget_clicked (GtkWidget *widget,
GradientSelect *gradient_sel);
static void gimp_gradient_select_widget_destroy (GtkWidget *widget,
GradientSelect *gradient_sel);
static void gimp_gradient_select_preview_size_allocate
(GtkWidget *widget,
GtkAllocation *allocation,
GradientSelect *gradient_sel);
static void gimp_gradient_select_preview_expose (GtkWidget *preview,
GdkEventExpose *event,
GradientSelect *gradient_sel);
static void gimp_gradient_select_drag_data_received (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
GtkSelectionData *selection,
guint info,
guint time);
static const GtkTargetEntry target = { "application/x-gimp-gradient-name", 0 };
static void compat_callback (GimpGradientSelectButton *gradient_button,
const gchar *gradient_name,
gint width,
const gdouble *grad_data,
gboolean dialog_closing,
gpointer data);
/**
* gimp_gradient_select_widget_new:
* @title: Title of the dialog to use or %NULL to use the default title.
* @gradient_name: Initial gradient name or %NULL to use current selection.
* @gradient_name: Initial gradient name.
* @callback: A function to call when the selected gradient changes.
* @data: A pointer to arbitary data to be used in the call to
* @callback.
* @data: A pointer to arbitary data to be used in the call to @callback.
*
* Creates a new #GtkWidget that completely controls the selection of
* a gradient. This widget is suitable for placement in a table in a
* plug-in dialog.
*
* Returns: A #GtkWidget that you can use in your UI.
*
* Since: GIMP 2.2
*/
GtkWidget *
gimp_gradient_select_widget_new (const gchar *title,
......@@ -107,70 +69,26 @@ gimp_gradient_select_widget_new (const gchar *title,
GimpRunGradientCallback callback,
gpointer data)
{
GradientSelect *gradient_sel;
GtkWidget *gradient_button;
CompatCallbackData *compat_data;
g_return_val_if_fail (callback != NULL, NULL);
if (! title)
title = _("Gradient Selection");
gradient_sel = g_new0 (GradientSelect, 1);
gradient_sel->title = g_strdup (title);
gradient_sel->callback = callback;
gradient_sel->data = data;
gradient_sel->sample_size = CELL_WIDTH;
gradient_sel->reverse = FALSE;
if (! gradient_name || ! strlen (gradient_name))
gradient_sel->gradient_name = gimp_context_get_gradient ();
else
gradient_sel->gradient_name = g_strdup (gradient_name);
gradient_sel->button = gtk_button_new ();
g_signal_connect (gradient_sel->button, "clicked",
G_CALLBACK (gimp_gradient_select_widget_clicked),
gradient_sel);
g_signal_connect (gradient_sel->button, "destroy",
G_CALLBACK (gimp_gradient_select_widget_destroy),
gradient_sel);
gtk_drag_dest_set (GTK_WIDGET (gradient_sel->button),
GTK_DEST_DEFAULT_HIGHLIGHT |
GTK_DEST_DEFAULT_MOTION |
GTK_DEST_DEFAULT_DROP,
&target, 1,
GDK_ACTION_COPY);
g_signal_connect (gradient_sel->button, "drag-data-received",
G_CALLBACK (gimp_gradient_select_drag_data_received),
NULL);
gradient_sel->preview = gtk_drawing_area_new ();
gtk_widget_set_size_request (gradient_sel->preview, CELL_WIDTH, CELL_HEIGHT);
gtk_container_add (GTK_CONTAINER (gradient_sel->button),
gradient_sel->preview);
gtk_widget_show (gradient_sel->preview);
gradient_button = gimp_gradient_select_button_new (title, gradient_name);
g_signal_connect (gradient_sel->preview, "size-allocate",
G_CALLBACK (gimp_gradient_select_preview_size_allocate),
gradient_sel);
compat_data = g_new (CompatCallbackData, 1);
compat_data->callback = callback;
compat_data->data = data;
g_signal_connect (gradient_sel->preview, "expose-event",
G_CALLBACK (gimp_gradient_select_preview_expose),
gradient_sel);
g_signal_connect_data (gradient_button, "gradient-set",
G_CALLBACK (compat_callback),
compat_data, (GClosureNotify) g_free, 0);
g_object_set_data (G_OBJECT (gradient_sel->button),
GRADIENT_SELECT_DATA_KEY, gradient_sel);
return gradient_sel->button;
return gradient_button;
}
/**
* gimp_gradient_select_widget_close;
* gimp_gradient_select_widget_close:
* @widget: A gradient select widget.
*
* Closes the popup window associated with @widget.
......@@ -178,266 +96,40 @@ gimp_gradient_select_widget_new (const gchar *title,
void
gimp_gradient_select_widget_close (GtkWidget *widget)
{
GradientSelect *gradient_sel;
gradient_sel = g_object_get_data (G_OBJECT (widget),
GRADIENT_SELECT_DATA_KEY);
g_return_if_fail (widget != NULL);
g_return_if_fail (gradient_sel != NULL);
if (gradient_sel->temp_gradient_callback)
{
gimp_gradient_select_destroy (gradient_sel->temp_gradient_callback);
gradient_sel->temp_gradient_callback = NULL;
}
gimp_select_button_close_popup (GIMP_SELECT_BUTTON (widget));
}
/**
* gimp_gradient_select_widget_set:
* gimp_gradient_select_widget_set;
* @widget: A gradient select widget.
* @gradient_name: Gradient name to set.
*
* Sets the current gradient for the gradient select widget. Calls
* the callback function if one was supplied in the call to
* Sets the current gradient for the gradient select widget. Calls the
* callback function if one was supplied in the call to
* gimp_gradient_select_widget_new().
*/
void
gimp_gradient_select_widget_set (GtkWidget *widget,
const gchar *gradient_name)
{
GradientSelect *gradient_sel;
gradient_sel = g_object_get_data (G_OBJECT (widget),
GRADIENT_SELECT_DATA_KEY);
g_return_if_fail (gradient_sel != NULL);
if (gradient_sel->temp_gradient_callback)
{
gimp_gradients_set_popup (gradient_sel->temp_gradient_callback,
gradient_name);
}
else
{
gchar *name;
gdouble *samples;
gint n_samples;
if (! gradient_name || ! strlen (gradient_name))
name = gimp_context_get_gradient ();
else
name = g_strdup (gradient_name);
if (gimp_gradient_get_uniform_samples (name,
gradient_sel->sample_size,
gradient_sel->reverse,
&n_samples,
&samples))
{
gimp_gradient_select_widget_callback (name,
n_samples, samples,
FALSE, gradient_sel);
g_free (samples);
}
g_return_if_fail (widget != NULL);
g_free (name);
}
gimp_gradient_select_button_set_gradient_name
(GIMP_GRADIENT_SELECT_BUTTON (widget), gradient_name);
}
/* private functions */
static void
gimp_gradient_select_widget_callback (const gchar *name,
gint n_samples,
const gdouble *gradient_data,
gboolean closing,
gpointer data)
compat_callback (GimpGradientSelectButton *gradient_button,
const gchar *gradient_name,
gint width,
const gdouble *grad_data,
gboolean dialog_closing,
gpointer data)
{
GradientSelect *gradient_sel = data;
g_free (gradient_sel->gradient_name);
g_free (gradient_sel->gradient_data);
gradient_sel->gradient_name = g_strdup (name);
gradient_sel->n_samples = n_samples;
gradient_sel->gradient_data = g_memdup (gradient_data,
n_samples * sizeof (gdouble));
gtk_widget_queue_draw (gradient_sel->preview);
if (gradient_sel->callback)
gradient_sel->callback (name,
n_samples, gradient_data, closing,
gradient_sel->data);
if (closing)
gradient_sel->temp_gradient_callback = NULL;
}
static void
gimp_gradient_select_widget_clicked (GtkWidget *widget,
GradientSelect *gradient_sel)
{
if (gradient_sel->temp_gradient_callback)
{
/* calling gimp_gradients_set_popup() raises the dialog */
gimp_gradients_set_popup (gradient_sel->temp_gradient_callback,
gradient_sel->gradient_name);
}
else
{
gradient_sel->temp_gradient_callback =
gimp_gradient_select_new (gradient_sel->title,
gradient_sel->gradient_name,
gradient_sel->sample_size,