Commit c688e055 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Default to "Cancel" in the "Really Quit?" dialog.

1999-12-02  Michael Natterer  <mitch@gimp.org>

	* app/app_procs.c: Default to "Cancel" in the "Really Quit?" dialog.

	* app/app_procs.c
	* app/brush_select.c
	* app/gimpbrushlist.c: Call brush_select_[freeze|thaw]_all() from
	brushes_init() and brushes_free(), so refreshing the brushes from
	plugins/scripts is faster.

	* app/brightness_contrast.c
	* app/color_balance.c
	* app/curves.c
	* app/file_new_dialog.c
	* app/hue_saturation.c
	* app/levels.c
	* app/posterize.c
	* app/threshold.c:
	Reorder the action are buttons: [ "OK" "Reset" "Cancel" ]

	* app/menus.c: Some more cleanups in the menu code. Reorder
	<Image>/Filters/Misc only if ot exists. Generalized
	menu_translate() in preparation for correctly supporting catalogs
	which only exist sometimes (like gimp-perl).

	* app/gradient.c
	* app/gradient_select.c: Save some lines of code by using
	gtk_clist_new_with_titles() instead of gtk_clist_new().

	* libgimp/gimpunitmenu.c: Code cleanup and made the clist titles
	of the unit selection un-clickable.
parent 35cc6abc
1999-12-02 Michael Natterer <mitch@gimp.org>
* app/app_procs.c: Default to "Cancel" in the "Really Quit?" dialog.
* app/app_procs.c
* app/brush_select.c
* app/gimpbrushlist.c: Call brush_select_[freeze|thaw]_all() from
brushes_init() and brushes_free(), so refreshing the brushes from
plugins/scripts is faster.
* app/brightness_contrast.c
* app/color_balance.c
* app/curves.c
* app/file_new_dialog.c
* app/hue_saturation.c
* app/levels.c
* app/posterize.c
* app/threshold.c:
Reorder the action are buttons: [ "OK" "Reset" "Cancel" ]
* app/menus.c: Some more cleanups in the menu code. Reorder
<Image>/Filters/Misc only if ot exists. Generalized
menu_translate() in preparation for correctly supporting catalogs
which only exist sometimes (like gimp-perl).
* app/gradient.c
* app/gradient_select.c: Save some lines of code by using
gtk_clist_new_with_titles() instead of gtk_clist_new().
* libgimp/gimpunitmenu.c: Code cleanup and made the clist titles
of the unit selection un-clickable.
Thu Dec 2 01:18:33 MET 1999 Sven Neumann <sven@gimp.org>
* plug-ins/common/grid.c: more chainbuttons and nicer dialog layout
......
......@@ -658,11 +658,6 @@ app_exit_finish (void)
named_buffers_free ();
swapping_free ();
brush_dialog_free ();
/* there may be dialogs still waiting for brush signals */
if (!no_interface)
brush_select_freeze_all ();
brushes_free ();
pattern_dialog_free ();
patterns_free ();
......@@ -750,9 +745,9 @@ really_quit_dialog (void)
FALSE, TRUE, FALSE,
_("Quit"), really_quit_callback,
NULL, NULL, TRUE, FALSE,
NULL, NULL, FALSE, FALSE,
_("Cancel"), really_quit_cancel_callback,
NULL, NULL, FALSE, TRUE,
NULL, NULL, TRUE, TRUE,
NULL);
......
......@@ -266,10 +266,10 @@ color_balance_dialog_new (void)
GTK_WIN_POS_NONE,
FALSE, TRUE, FALSE,
_("Reset"), color_balance_reset_callback,
cbd, NULL, TRUE, FALSE,
_("OK"), color_balance_ok_callback,
cbd, NULL, TRUE, FALSE,
_("Reset"), color_balance_reset_callback,
cbd, NULL, TRUE, FALSE,
_("Cancel"), color_balance_cancel_callback,
cbd, NULL, FALSE, TRUE,
......
......@@ -557,10 +557,10 @@ curves_dialog_new (void)
GTK_WIN_POS_NONE,
FALSE, TRUE, FALSE,
_("Reset"), curves_reset_callback,
cd, NULL, FALSE, FALSE,
_("OK"), curves_ok_callback,
cd, NULL, TRUE, FALSE,
_("Reset"), curves_reset_callback,
cd, NULL, FALSE, FALSE,
_("Cancel"), curves_cancel_callback,
cd, NULL, FALSE, TRUE,
......
......@@ -368,10 +368,10 @@ hue_saturation_dialog_new (void)
GTK_WIN_POS_NONE,
FALSE, TRUE, FALSE,
_("Reset"), hue_saturation_reset_callback,
hsd, NULL, FALSE, FALSE,
_("OK"), hue_saturation_ok_callback,
hsd, NULL, TRUE, FALSE,
_("Reset"), hue_saturation_reset_callback,
hsd, NULL, FALSE, FALSE,
_("Cancel"), hue_saturation_cancel_callback,
hsd, NULL, FALSE, TRUE,
......
......@@ -267,10 +267,10 @@ threshold_dialog_new (void)
GTK_WIN_POS_NONE,
FALSE, TRUE, FALSE,
_("Reset"), threshold_reset_callback,
td, NULL, TRUE, FALSE,
_("OK"), threshold_ok_callback,
td, NULL, TRUE, FALSE,
_("Reset"), threshold_reset_callback,
td, NULL, TRUE, FALSE,
_("Cancel"), threshold_cancel_callback,
td, NULL, FALSE, TRUE,
......
......@@ -210,10 +210,10 @@ brightness_contrast_dialog_new (void)
GTK_WIN_POS_NONE,
FALSE, TRUE, FALSE,
_("Reset"), brightness_contrast_reset_callback,
bcd, NULL, TRUE, FALSE,
_("OK"), brightness_contrast_ok_callback,
bcd, NULL, TRUE, FALSE,
_("Reset"), brightness_contrast_reset_callback,
bcd, NULL, TRUE, FALSE,
_("Cancel"), brightness_contrast_cancel_callback,
bcd, NULL, FALSE, TRUE,
......
......@@ -1734,12 +1734,8 @@ static void
brush_select_refresh_callback (GtkWidget *widget,
gpointer data)
{
brush_select_freeze_all ();
/* re-init the brush list */
brushes_init (FALSE);
brush_select_thaw_all ();
}
static void
......
......@@ -266,10 +266,10 @@ color_balance_dialog_new (void)
GTK_WIN_POS_NONE,
FALSE, TRUE, FALSE,
_("Reset"), color_balance_reset_callback,
cbd, NULL, TRUE, FALSE,
_("OK"), color_balance_ok_callback,
cbd, NULL, TRUE, FALSE,
_("Reset"), color_balance_reset_callback,
cbd, NULL, TRUE, FALSE,
_("Cancel"), color_balance_cancel_callback,
cbd, NULL, FALSE, TRUE,
......
......@@ -557,10 +557,10 @@ curves_dialog_new (void)
GTK_WIN_POS_NONE,
FALSE, TRUE, FALSE,
_("Reset"), curves_reset_callback,
cd, NULL, FALSE, FALSE,
_("OK"), curves_ok_callback,
cd, NULL, TRUE, FALSE,
_("Reset"), curves_reset_callback,
cd, NULL, FALSE, FALSE,
_("Cancel"), curves_cancel_callback,
cd, NULL, FALSE, TRUE,
......
......@@ -374,10 +374,10 @@ ui_new_image_window_create (const GimpImageNewValues *values_orig)
GTK_WIN_POS_MOUSE,
FALSE, FALSE, TRUE,
_("Reset"), file_new_reset_callback,
info, NULL, FALSE, FALSE,
_("OK"), file_new_ok_callback,
info, NULL, TRUE, FALSE,
_("Reset"), file_new_reset_callback,
info, NULL, FALSE, FALSE,
_("Cancel"), file_new_cancel_callback,
info, NULL, FALSE, TRUE,
......
......@@ -374,10 +374,10 @@ ui_new_image_window_create (const GimpImageNewValues *values_orig)
GTK_WIN_POS_MOUSE,
FALSE, FALSE, TRUE,
_("Reset"), file_new_reset_callback,
info, NULL, FALSE, FALSE,
_("OK"), file_new_ok_callback,
info, NULL, TRUE, FALSE,
_("Reset"), file_new_reset_callback,
info, NULL, FALSE, FALSE,
_("Cancel"), file_new_cancel_callback,
info, NULL, FALSE, TRUE,
......
......@@ -34,6 +34,7 @@
#include "gimpbrushgenerated.h"
#include "gimpbrushpipe.h"
#include "brush_header.h"
#include "brush_select.h"
#include "datafiles.h"
#include "gimprc.h"
#include "gimpsignal.h"
......@@ -119,7 +120,7 @@ gimp_brush_list_get_type (void)
}
GimpBrushList *
gimp_brush_list_new ()
gimp_brush_list_new (void)
{
GimpBrushList *list;
......@@ -141,8 +142,14 @@ brushes_init (int no_data)
brush_list = gimp_brush_list_new ();
if (brush_path != NULL && !no_data)
datafiles_read_directories (brush_path,
(datafile_loader_t) brushes_brush_load, 0);
{
brush_select_freeze_all ();
datafiles_read_directories (brush_path,
(datafile_loader_t) brushes_brush_load, 0);
brush_select_thaw_all ();
}
gimp_context_refresh_brushes ();
}
......@@ -215,10 +222,12 @@ brush_compare_func (gconstpointer first,
}
void
brushes_free ()
brushes_free (void)
{
if (brush_list)
{
brush_select_freeze_all ();
while (GIMP_LIST (brush_list)->list)
{
GimpBrush * b = GIMP_BRUSH (GIMP_LIST (brush_list)->list->data);
......@@ -290,6 +299,8 @@ brushes_free ()
gimp_brush_list_remove (brush_list, b);
}
brush_select_thaw_all ();
}
}
......
......@@ -328,10 +328,11 @@ static void gradient_editor_drop_gradient (GtkWidget *widget,
/* Gradient editor functions */
static GtkWidget *ed_create_button (gchar *label,
double xalign, double yalign,
GtkSignalFunc signal_func,
gpointer user_data);
static GtkWidget *ed_create_button (gchar *label,
gdouble xalign,
gdouble yalign,
GtkSignalFunc signal_func,
gpointer data);
static void ed_fetch_foreground (double *fg_r, double *fg_g, double *fg_b,
double *fg_a);
......@@ -855,12 +856,13 @@ gradient_editor_create (void)
GtkWidget *frame;
GtkWidget *scrolled_win;
GdkColormap *colormap;
GtkWidget* pixmapwid;
GdkPixmap* pixmap;
GdkBitmap* mask;
GtkStyle* style;
gint i;
gint select_pos;
GtkWidget *pixmapwid;
GdkPixmap *pixmap;
GdkBitmap *mask;
GtkStyle *style;
gchar *titles[2];
gint select_pos;
gint i;
/* If the editor already exists, just show it */
if (g_editor)
......@@ -904,28 +906,23 @@ gradient_editor_create (void)
/* clist preview of gradients */
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
gtk_box_pack_start (GTK_BOX (hbox), scrolled_win, TRUE, TRUE, 0);
gtk_widget_show (scrolled_win);
g_editor->clist = gtk_clist_new (2);
titles[0] = _("Gradient");
titles[1] = _("Name");
g_editor->clist = gtk_clist_new_with_titles (2, titles);
gtk_clist_set_shadow_type (GTK_CLIST (g_editor->clist), GTK_SHADOW_IN);
gtk_clist_set_row_height (GTK_CLIST (g_editor->clist), 18);
gtk_clist_set_selection_mode (GTK_CLIST (g_editor->clist),
GTK_SELECTION_BROWSE);
gtk_clist_set_column_width (GTK_CLIST (g_editor->clist), 0, 52);
gtk_clist_set_column_title (GTK_CLIST (g_editor->clist), 0, _("Gradient"));
gtk_clist_set_column_title (GTK_CLIST (g_editor->clist), 1, _("Name"));
gtk_clist_column_titles_show (GTK_CLIST (g_editor->clist));
gtk_clist_set_row_height (GTK_CLIST (g_editor->clist), 18);
gtk_clist_set_use_drag_icons (GTK_CLIST (g_editor->clist), FALSE);
gtk_clist_column_titles_passive (GTK_CLIST (g_editor->clist));
gtk_box_pack_start (GTK_BOX (hbox), scrolled_win, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (scrolled_win), g_editor->clist);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
gtk_widget_show (scrolled_win);
gtk_widget_show (g_editor->clist);
colormap = gtk_widget_get_colormap (g_editor->clist);
......@@ -965,31 +962,36 @@ gradient_editor_create (void)
/* Buttons for gradient functions */
button = ed_create_button (_("New Gradient"), 0.5, 0.5,
(GtkSignalFunc) ed_new_gradient_callback, NULL);
GTK_SIGNAL_FUNC (ed_new_gradient_callback),
NULL);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_box_pack_start (GTK_BOX (gvbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
button = ed_create_button (_("Copy Gradient"), 0.5, 0.5,
(GtkSignalFunc) ed_copy_gradient_callback, NULL);
GTK_SIGNAL_FUNC (ed_copy_gradient_callback),
NULL);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_box_pack_start (GTK_BOX (gvbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
button = ed_create_button (_("Delete Gradient"), 0.5, 0.5,
(GtkSignalFunc) ed_delete_gradient_callback, NULL);
GTK_SIGNAL_FUNC (ed_delete_gradient_callback),
NULL);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_box_pack_start (GTK_BOX (gvbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
button = ed_create_button (_("Rename Gradient"), 0.5, 0.5,
(GtkSignalFunc) ed_rename_gradient_callback, NULL);
GTK_SIGNAL_FUNC (ed_rename_gradient_callback),
NULL);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_box_pack_start (GTK_BOX (gvbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
button = ed_create_button (_("Save as POV-Ray"), 0.5, 0.5,
(GtkSignalFunc) ed_save_pov_callback, NULL);
GTK_SIGNAL_FUNC (ed_save_pov_callback),
NULL);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_box_pack_start (GTK_BOX (gvbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
......@@ -1005,7 +1007,8 @@ gradient_editor_create (void)
/* Zoom all button */
button = ed_create_button (_("Zoom all"), 0.5, 0.5,
(GtkSignalFunc) ed_zoom_all_callback, g_editor);
GTK_SIGNAL_FUNC (ed_zoom_all_callback),
g_editor);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
......@@ -1053,10 +1056,10 @@ gradient_editor_create (void)
1.0);
gtk_signal_connect (g_editor->scroll_data, "value_changed",
(GtkSignalFunc) ed_scrollbar_update,
GTK_SIGNAL_FUNC (ed_scrollbar_update),
g_editor);
gtk_signal_connect (g_editor->scroll_data, "changed",
(GtkSignalFunc) ed_scrollbar_update,
GTK_SIGNAL_FUNC (ed_scrollbar_update),
g_editor);
g_editor->scrollbar =
......@@ -1072,7 +1075,7 @@ gradient_editor_create (void)
button = gtk_check_button_new_with_label (_("Instant update"));
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
(GtkSignalFunc) ed_instant_update_update,
GTK_SIGNAL_FUNC (ed_instant_update_update),
g_editor);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
gtk_widget_show (button);
......@@ -1105,7 +1108,7 @@ gradient_editor_create (void)
gtk_widget_set_events (g_editor->preview, GRAD_PREVIEW_EVENT_MASK);
gtk_signal_connect (GTK_OBJECT(g_editor->preview), "event",
(GdkEventFunc) prev_events,
GTK_SIGNAL_FUNC (prev_events),
g_editor);
gtk_drag_dest_set (g_editor->preview,
......@@ -1343,10 +1346,10 @@ ed_update_editor (int flags)
static GtkWidget *
ed_create_button (gchar *label,
double xalign,
double yalign,
gdouble xalign,
gdouble yalign,
GtkSignalFunc signal_func,
gpointer user_data)
gpointer data)
{
GtkWidget *button;
GtkWidget *text;
......@@ -1361,8 +1364,8 @@ ed_create_button (gchar *label,
if (signal_func != NULL)
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) signal_func,
user_data);
signal_func,
data);
return button;
}
......@@ -1373,7 +1376,7 @@ static void
ed_set_hint (gchar *str)
{
gtk_label_set_text (GTK_LABEL (g_editor->hint_label), str);
gdk_flush();
/*gdk_flush();*/
}
/*****/
......@@ -2354,10 +2357,10 @@ prev_events (GtkWidget *widget,
static void
prev_set_hint (gint x)
{
double xpos;
double r, g, b, a;
double h, s, v;
gchar str[256];
gdouble xpos;
gdouble r, g, b, a;
gdouble h, s, v;
gchar str[512];
xpos = control_calc_g_pos (x);
......@@ -2955,7 +2958,7 @@ control_extend_selection (grad_segment_t *seg,
double pos)
{
if (fabs (pos - g_editor->control_sel_l->left) <
fabs(pos - g_editor->control_sel_r->right))
fabs (pos - g_editor->control_sel_r->right))
g_editor->control_sel_l = seg;
else
g_editor->control_sel_r = seg;
......@@ -2967,9 +2970,9 @@ static void
control_motion (gint x)
{
grad_segment_t *seg;
double pos;
double delta;
char str[256];
gdouble pos;
gdouble delta;
gchar str[256];
seg = g_editor->control_drag_segment;
......
......@@ -328,10 +328,11 @@ static void gradient_editor_drop_gradient (GtkWidget *widget,
/* Gradient editor functions */
static GtkWidget *ed_create_button (gchar *label,
double xalign, double yalign,
GtkSignalFunc signal_func,
gpointer user_data);
static GtkWidget *ed_create_button (gchar *label,
gdouble xalign,
gdouble yalign,
GtkSignalFunc signal_func,
gpointer data);
static void ed_fetch_foreground (double *fg_r, double *fg_g, double *fg_b,
double *fg_a);
......@@ -855,12 +856,13 @@ gradient_editor_create (void)
GtkWidget *frame;
GtkWidget *scrolled_win;
GdkColormap *colormap;
GtkWidget* pixmapwid;
GdkPixmap* pixmap;
GdkBitmap* mask;
GtkStyle* style;
gint i;
gint select_pos;
GtkWidget *pixmapwid;
GdkPixmap *pixmap;
GdkBitmap *mask;
GtkStyle *style;
gchar *titles[2];
gint select_pos;
gint i;
/* If the editor already exists, just show it */
if (g_editor)
......@@ -904,28 +906,23 @@ gradient_editor_create (void)
/* clist preview of gradients */
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
gtk_box_pack_start (GTK_BOX (hbox), scrolled_win, TRUE, TRUE, 0);
gtk_widget_show (scrolled_win);
g_editor->clist = gtk_clist_new (2);
titles[0] = _("Gradient");
titles[1] = _("Name");
g_editor->clist = gtk_clist_new_with_titles (2, titles);
gtk_clist_set_shadow_type (GTK_CLIST (g_editor->clist), GTK_SHADOW_IN);
gtk_clist_set_row_height (GTK_CLIST (g_editor->clist), 18);
gtk_clist_set_selection_mode (GTK_CLIST (g_editor->clist),
GTK_SELECTION_BROWSE);
gtk_clist_set_column_width (GTK_CLIST (g_editor->clist), 0, 52);
gtk_clist_set_column_title (GTK_CLIST (g_editor->clist), 0, _("Gradient"));
gtk_clist_set_column_title (GTK_CLIST (g_editor->clist), 1, _("Name"));
gtk_clist_column_titles_show (GTK_CLIST (g_editor->clist));
gtk_clist_set_row_height (GTK_CLIST (g_editor->clist), 18);
gtk_clist_set_use_drag_icons (GTK_CLIST (g_editor->clist), FALSE);
gtk_clist_column_titles_passive (GTK_CLIST (g_editor->clist));
gtk_box_pack_start (GTK_BOX (hbox), scrolled_win, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (scrolled_win), g_editor->clist);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
gtk_widget_show (scrolled_win);
gtk_widget_show (g_editor->clist);
colormap = gtk_widget_get_colormap (g_editor->clist);
......@@ -965,31 +962,36 @@ gradient_editor_create (void)
/* Buttons for gradient functions */
button = ed_create_button (_("New Gradient"), 0.5, 0.5,
(GtkSignalFunc) ed_new_gradient_callback, NULL);
GTK_SIGNAL_FUNC (ed_new_gradient_callback),
NULL);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_box_pack_start (GTK_BOX (gvbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
button = ed_create_button (_("Copy Gradient"), 0.5, 0.5,
(GtkSignalFunc) ed_copy_gradient_callback, NULL);
GTK_SIGNAL_FUNC (ed_copy_gradient_callback),
NULL);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_box_pack_start (GTK_BOX (gvbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
button = ed_create_button (_("Delete Gradient"), 0.5, 0.5,
(GtkSignalFunc) ed_delete_gradient_callback, NULL);
GTK_SIGNAL_FUNC (ed_delete_gradient_callback),
NULL);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_box_pack_start (GTK_BOX (gvbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
button = ed_create_button (_("Rename Gradient"), 0.5, 0.5,
(GtkSignalFunc) ed_rename_gradient_callback, NULL);
GTK_SIGNAL_FUNC (ed_rename_gradient_callback),
NULL);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_box_pack_start (GTK_BOX (gvbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
button = ed_create_button (_("Save as POV-Ray"), 0.5, 0.5,
(GtkSignalFunc) ed_save_pov_callback, NULL);
GTK_SIGNAL_FUNC (ed_save_pov_callback),
NULL);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_box_pack_start (GTK_BOX (gvbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
......@@ -1005,7 +1007,8 @@ gradient_editor_create (void)
/* Zoom all button */
button = ed_create_button (_("Zoom all"), 0.5, 0.5,
(GtkSignalFunc) ed_zoom_all_callback, g_editor);
GTK_SIGNAL_FUNC (ed_zoom_all_callback),
g_editor);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
......@@ -1053,10 +1056,10 @@ gradient_editor_create (void)
1.0);
gtk_signal_connect (g_editor->scroll_data, "value_changed",
(GtkSignalFunc) ed_scrollbar_update,
GTK_SIGNAL_FUNC (ed_scrollbar_update),
g_editor);
gtk_signal_connect (g_editor->scroll_data, "changed",
(GtkSignalFunc) ed_scrollbar_update,
GTK_SIGNAL_FUNC (ed_scrollbar_update),
g_editor);
g_editor->scrollbar =
......@@ -1072,7 +1075,7 @@ gradient_editor_create (void)
button = gtk_check_button_new_with_label (_("Instant update"));
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
(GtkSignalFunc) ed_instant_update_update,
GTK_SIGNAL_FUNC (ed_instant_update_update),
g_editor);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
gtk_widget_show (button);
......@@ -1105,7 +1108,7 @@ gradient_editor_create (void)
gtk_widget_set_events (g_editor->preview, GRAD_PREVIEW_EVENT_MASK);
gtk_signal_connect (GTK_OBJECT(g_editor->preview), "event",
(GdkEventFunc) prev_events,
GTK_SIGNAL_FUNC (prev_events),
g_editor);
gtk_drag_dest_set (g_editor->preview,
......@@ -1343,10 +1346,10 @@ ed_update_editor (int flags)
static GtkWidget *
ed_create_button (gchar *label,
double xalign,
double yalign,
gdouble xalign,
gdouble yalign,
GtkSignalFunc signal_func,
gpointer user_data)
gpointer data)
{
GtkWidget *button;
GtkWidget *text;
......@@ -1361,8 +1364,8 @@ ed_create_button (gchar *label,
if (signal_func != NULL)
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) signal_func,
user_data);
signal_func,
data);
return button;
}
......@@ -1373,7 +1376,7 @@ static void
ed_set_hint (gchar *str)
{
gtk_label_set_text (GTK_LABEL (g_editor->hint_label), str);
gdk_flush();
/*gdk_flush();*/
}
/*****/
......@@ -2354,10 +2357,10 @@ prev_events (GtkWidget *widget,
static void
prev_set_hint (gint x)
{
double xpos;
double r, g, b, a;
double h, s, v;
gchar str[256];
gdouble xpos;
gdouble r, g, b, a;
gdouble h, s, v;
gchar str[512];
xpos = control_calc_g_pos (x);
......@@ -2955,7 +2958,7 @@ control_extend_selection (grad_segment_t *seg,
double pos)
{
if (fabs (pos - g_editor->control_sel_l->left) <
fabs(pos - g_editor->control_sel_r->right))
fabs (pos - g_editor->control_sel_r->right))
g_editor->control_sel_l = seg;
else
g_editor->control_sel_r = seg;
......@@ -2967,9 +2970,9 @@ static void
control_motion (gint x)
{
grad_segment_t *seg;
double pos;
double delta;
char str[256];
gdouble pos;
gdouble delta;
gchar str[256];
seg = g_editor->control_drag_segment;
......
......@@ -123,10 +123,11 @@ GradientSelect *
gradient_select_new (gchar *title,
gchar *initial_gradient)
{
GradientSelect *gsp;
GradientSelect *gsp;
GtkWidget *vbox;
GtkWidget *scrolled_win;
GdkColormap *colormap;
gchar *titles[2];
gint select_pos;
gradient_t *active = NULL;
......@@ -195,29 +196,24 @@ gradient_select_new (gchar *title,
/* clist preview of gradients */
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
gtk_container_add (GTK_CONTAINER (vbox), scrolled_win);
gtk_widget_show (scrolled_win);
gsp->clist = gtk_clist_new (2);
titles[0] = _("Gradient");
titles[1] = _("Name");
gsp->clist = gtk_clist_new_with_titles (2, titles);