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

libgimp/Makefile.am simple widget which creates a pixmap from XPM data

2000-02-18  Michael Natterer  <mitch@gimp.org>

	* libgimp/Makefile.am
	* libgimp/gimppixmap.[ch]: simple widget which creates a pixmap
	from XPM data without the need to worry about it's parent's
	"realized" state and other stuff.

	* libgimp/gimpcolorbutton.c: removed a gtk-doc comment from an
	internal function.

	* libgimp/gimpwidgets.[ch]: new function gimp_pixmap_button_new().

	* app/gimpui.h
	* libgimp/gimpui.h: include gimppixmap.h.

	* app/gradient.c
	* app/nav_window.c
	* app/palette.c
	* libgimp/gimpfileselection.[ch]
	* libgimp/gimppatheditor.c
	* libgimp/gimpquerybox.c
	* plug-ins/FractalExplorer/FractalExplorer.c: use GimpPixmaps.

	* plug-ins/Lighting/*
	* plug-ins/MapObject/*: some more cleanups: reduced # of includes,
	made private functions static, use GimpPixmaps.

	* plug-ins/libgck/Makefile.am
	* plug-ins/libgck/NEWS
	* plug-ins/libgck/README
	* plug-ins/libgck/TODO
	* plug-ins/libgck/docs/html/gck.html
	* plug-ins/libgck/docs/html/gck_application_window.html
	* plug-ins/libgck/docs/html/gck_dialog_window.html
	* plug-ins/libgck/docs/html/gckmath.html
	* plug-ins/libgck/docs/html/gckui.html
	* plug-ins/libgck/docs/html/gckvector.html: removed because they
	documented files which don't exist any more.
parent 31dfe3ee
2000-02-18 Michael Natterer <mitch@gimp.org>
* libgimp/Makefile.am
* libgimp/gimppixmap.[ch]: simple widget which creates a pixmap
from XPM data without the need to worry about it's parent's
"realized" state and other stuff.
* libgimp/gimpcolorbutton.c: removed a gtk-doc comment from an
internal function.
* libgimp/gimpwidgets.[ch]: new function gimp_pixmap_button_new().
* app/gimpui.h
* libgimp/gimpui.h: include gimppixmap.h.
* app/gradient.c
* app/nav_window.c
* app/palette.c
* libgimp/gimpfileselection.[ch]
* libgimp/gimppatheditor.c
* libgimp/gimpquerybox.c
* plug-ins/FractalExplorer/FractalExplorer.c: use GimpPixmaps.
* plug-ins/Lighting/*
* plug-ins/MapObject/*: some more cleanups: reduced # of includes,
made private functions static, use GimpPixmaps.
* plug-ins/libgck/Makefile.am
* plug-ins/libgck/NEWS
* plug-ins/libgck/README
* plug-ins/libgck/TODO
* plug-ins/libgck/docs/html/gck.html
* plug-ins/libgck/docs/html/gck_application_window.html
* plug-ins/libgck/docs/html/gck_dialog_window.html
* plug-ins/libgck/docs/html/gckmath.html
* plug-ins/libgck/docs/html/gckui.html
* plug-ins/libgck/docs/html/gckvector.html: removed because they
documented files which don't exist any more.
Fri Feb 18 10:43:30 CET 2000 Sven Neumann <sven@gimp.org>
* plug-ins/ifscompose/ifscompose.c:
......@@ -7,7 +46,7 @@ Fri Feb 18 10:43:30 CET 2000 Sven Neumann <sven@gimp.org>
* libgimp/gimpcolorbutton.[ch]: new function
gimp_color_button_double_new() which uses an array of gdouble
instead uf guchar to store the color.
instead of guchar to store the color.
* libgimp/gimpwidgets.h: added macros for easier access of the
scale_entries widgets.
......
......@@ -1066,41 +1066,26 @@ zoom_adj_changed (GtkAdjustment *adj,
static GtkWidget *
nav_create_button_area (InfoDialog *info_win)
{
GtkWidget *hbox1;
GtkWidget *vbox1;
GtkWidget *button;
GtkWidget *hscale1;
GtkWidget *label1;
GtkObject *adjustment;
GdkPixmap *pixmap;
GtkWidget *pixmapwid;
GdkBitmap *mask;
GtkStyle *style;
GtkWidget *hbox1;
GtkWidget *vbox1;
GtkWidget *button;
GtkWidget *hscale1;
GtkWidget *label1;
GtkObject *adjustment;
NavWinData *iwd;
gchar scale_str[MAX_SCALE_BUF];
gchar scale_str[MAX_SCALE_BUF];
iwd = (NavWinData *)info_win->user_data;
iwd = (NavWinData *) info_win->user_data;
hbox1 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox1);
style = gtk_widget_get_style (info_win->shell);
button = gtk_button_new ();
button = gimp_pixmap_button_new (zoom_out_xpm);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (navwindow_zoomout), (gpointer) info_win->user_data);
GTK_SIGNAL_FUNC (navwindow_zoomout),
(gpointer) info_win->user_data);
gtk_box_pack_start (GTK_BOX (hbox1), button, FALSE, FALSE, 0);
pixmap = gdk_pixmap_create_from_xpm_d (info_win->shell->window, &mask,
&style->bg[GTK_STATE_NORMAL],
zoom_out_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
vbox1 = gtk_vbox_new (FALSE, 0);
......@@ -1130,21 +1115,12 @@ nav_create_button_area (InfoDialog *info_win)
gtk_box_pack_start (GTK_BOX (vbox1), hscale1, TRUE, TRUE, 0);
gtk_scale_set_draw_value (GTK_SCALE (hscale1), FALSE);
button = gtk_button_new ();
button = gimp_pixmap_button_new (zoom_in_xpm);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (navwindow_zoomin), (gpointer) info_win->user_data);
GTK_SIGNAL_FUNC (navwindow_zoomin),
(gpointer) info_win->user_data);
gtk_box_pack_start (GTK_BOX (hbox1), button, FALSE, FALSE, 0);
pixmap = gdk_pixmap_create_from_xpm_d (info_win->shell->window, &mask,
&style->bg[GTK_STATE_NORMAL],
zoom_in_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
return vbox1;
......
......@@ -1066,41 +1066,26 @@ zoom_adj_changed (GtkAdjustment *adj,
static GtkWidget *
nav_create_button_area (InfoDialog *info_win)
{
GtkWidget *hbox1;
GtkWidget *vbox1;
GtkWidget *button;
GtkWidget *hscale1;
GtkWidget *label1;
GtkObject *adjustment;
GdkPixmap *pixmap;
GtkWidget *pixmapwid;
GdkBitmap *mask;
GtkStyle *style;
GtkWidget *hbox1;
GtkWidget *vbox1;
GtkWidget *button;
GtkWidget *hscale1;
GtkWidget *label1;
GtkObject *adjustment;
NavWinData *iwd;
gchar scale_str[MAX_SCALE_BUF];
gchar scale_str[MAX_SCALE_BUF];
iwd = (NavWinData *)info_win->user_data;
iwd = (NavWinData *) info_win->user_data;
hbox1 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox1);
style = gtk_widget_get_style (info_win->shell);
button = gtk_button_new ();
button = gimp_pixmap_button_new (zoom_out_xpm);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (navwindow_zoomout), (gpointer) info_win->user_data);
GTK_SIGNAL_FUNC (navwindow_zoomout),
(gpointer) info_win->user_data);
gtk_box_pack_start (GTK_BOX (hbox1), button, FALSE, FALSE, 0);
pixmap = gdk_pixmap_create_from_xpm_d (info_win->shell->window, &mask,
&style->bg[GTK_STATE_NORMAL],
zoom_out_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
vbox1 = gtk_vbox_new (FALSE, 0);
......@@ -1130,21 +1115,12 @@ nav_create_button_area (InfoDialog *info_win)
gtk_box_pack_start (GTK_BOX (vbox1), hscale1, TRUE, TRUE, 0);
gtk_scale_set_draw_value (GTK_SCALE (hscale1), FALSE);
button = gtk_button_new ();
button = gimp_pixmap_button_new (zoom_in_xpm);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (navwindow_zoomin), (gpointer) info_win->user_data);
GTK_SIGNAL_FUNC (navwindow_zoomin),
(gpointer) info_win->user_data);
gtk_box_pack_start (GTK_BOX (hbox1), button, FALSE, FALSE, 0);
pixmap = gdk_pixmap_create_from_xpm_d (info_win->shell->window, &mask,
&style->bg[GTK_STATE_NORMAL],
zoom_in_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
return vbox1;
......
......@@ -26,6 +26,7 @@
#include "gimphelp.h"
#include "libgimp/gimpdialog.h"
#include "libgimp/gimppixmap.h"
#include "libgimp/gimpquerybox.h"
#include "libgimp/gimpwidgets.h"
......
......@@ -759,21 +759,17 @@ gradient_get_color_at (gradient_t *gradient,
void
gradient_editor_create (void)
{
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *gvbox;
GtkWidget *button;
GtkWidget *frame;
GtkWidget *scrolled_win;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *gvbox;
GtkWidget *button;
GtkWidget *frame;
GtkWidget *scrolled_win;
GdkColormap *colormap;
GtkWidget *pixmapwid;
GdkPixmap *pixmap;
GdkBitmap *mask;
GtkStyle *style;
gchar *titles[2];
gint column_width;
gint select_pos;
gint i;
gchar *titles[2];
gint column_width;
gint select_pos;
gint i;
/* If the editor already exists, just show it */
if (g_editor)
......@@ -934,42 +930,21 @@ gradient_editor_create (void)
/* + and - buttons */
gtk_widget_realize (g_editor->shell);
style = gtk_widget_get_style (g_editor->shell);
button = gtk_button_new ();
button = gimp_pixmap_button_new (zoom_in_xpm);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (ed_zoom_in_callback),
(gpointer) g_editor);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
pixmap = gdk_pixmap_create_from_xpm_d (g_editor->shell->window, &mask,
&style->bg[GTK_STATE_NORMAL],
zoom_in_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
button = gtk_button_new ();
button = gimp_pixmap_button_new (zoom_out_xpm);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (ed_zoom_out_callback),
(gpointer) g_editor);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
pixmap = gdk_pixmap_create_from_xpm_d (g_editor->shell->window, &mask,
&style->bg[GTK_STATE_NORMAL],
zoom_out_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
/* Scrollbar */
......@@ -1278,6 +1253,7 @@ ed_create_button (gchar *label,
GtkWidget *button;
button = gtk_button_new_with_label (label);
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
gtk_widget_show (button);
if (signal_func != NULL)
......
......@@ -759,21 +759,17 @@ gradient_get_color_at (gradient_t *gradient,
void
gradient_editor_create (void)
{
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *gvbox;
GtkWidget *button;
GtkWidget *frame;
GtkWidget *scrolled_win;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *gvbox;
GtkWidget *button;
GtkWidget *frame;
GtkWidget *scrolled_win;
GdkColormap *colormap;
GtkWidget *pixmapwid;
GdkPixmap *pixmap;
GdkBitmap *mask;
GtkStyle *style;
gchar *titles[2];
gint column_width;
gint select_pos;
gint i;
gchar *titles[2];
gint column_width;
gint select_pos;
gint i;
/* If the editor already exists, just show it */
if (g_editor)
......@@ -934,42 +930,21 @@ gradient_editor_create (void)
/* + and - buttons */
gtk_widget_realize (g_editor->shell);
style = gtk_widget_get_style (g_editor->shell);
button = gtk_button_new ();
button = gimp_pixmap_button_new (zoom_in_xpm);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (ed_zoom_in_callback),
(gpointer) g_editor);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
pixmap = gdk_pixmap_create_from_xpm_d (g_editor->shell->window, &mask,
&style->bg[GTK_STATE_NORMAL],
zoom_in_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
button = gtk_button_new ();
button = gimp_pixmap_button_new (zoom_out_xpm);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (ed_zoom_out_callback),
(gpointer) g_editor);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
pixmap = gdk_pixmap_create_from_xpm_d (g_editor->shell->window, &mask,
&style->bg[GTK_STATE_NORMAL],
zoom_out_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
/* Scrollbar */
......@@ -1278,6 +1253,7 @@ ed_create_button (gchar *label,
GtkWidget *button;
button = gtk_button_new_with_label (label);
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
gtk_widget_show (button);
if (signal_func != NULL)
......
......@@ -759,21 +759,17 @@ gradient_get_color_at (gradient_t *gradient,
void
gradient_editor_create (void)
{
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *gvbox;
GtkWidget *button;
GtkWidget *frame;
GtkWidget *scrolled_win;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *gvbox;
GtkWidget *button;
GtkWidget *frame;
GtkWidget *scrolled_win;
GdkColormap *colormap;
GtkWidget *pixmapwid;
GdkPixmap *pixmap;
GdkBitmap *mask;
GtkStyle *style;
gchar *titles[2];
gint column_width;
gint select_pos;
gint i;
gchar *titles[2];
gint column_width;
gint select_pos;
gint i;
/* If the editor already exists, just show it */
if (g_editor)
......@@ -934,42 +930,21 @@ gradient_editor_create (void)
/* + and - buttons */
gtk_widget_realize (g_editor->shell);
style = gtk_widget_get_style (g_editor->shell);
button = gtk_button_new ();
button = gimp_pixmap_button_new (zoom_in_xpm);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (ed_zoom_in_callback),
(gpointer) g_editor);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
pixmap = gdk_pixmap_create_from_xpm_d (g_editor->shell->window, &mask,
&style->bg[GTK_STATE_NORMAL],
zoom_in_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
button = gtk_button_new ();
button = gimp_pixmap_button_new (zoom_out_xpm);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (ed_zoom_out_callback),
(gpointer) g_editor);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
pixmap = gdk_pixmap_create_from_xpm_d (g_editor->shell->window, &mask,
&style->bg[GTK_STATE_NORMAL],
zoom_out_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
/* Scrollbar */
......@@ -1278,6 +1253,7 @@ ed_create_button (gchar *label,
GtkWidget *button;
button = gtk_button_new_with_label (label);
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
gtk_widget_show (button);
if (signal_func != NULL)
......
......@@ -2056,10 +2056,6 @@ palette_dialog_new (gint vert)
GtkWidget *alignment;
GtkWidget *frame;
GtkWidget *button;
GtkWidget *pixmapwid;
GdkPixmap *pixmap;
GdkBitmap *mask;
GtkStyle *style;
gchar *titles[3];
palette = g_new (PaletteDialog, 1);
......@@ -2190,36 +2186,18 @@ palette_dialog_new (gint vert)
palette);
/* + and - buttons */
if (! GTK_WIDGET_REALIZED (palette->shell))
gtk_widget_realize (palette->shell);
style = gtk_widget_get_style (palette->shell);
button = gtk_button_new ();
button = gimp_pixmap_button_new (zoom_in_xpm);
gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
pixmap = gdk_pixmap_create_from_xpm_d (palette->shell->window, &mask,
&style->bg[GTK_STATE_NORMAL],
zoom_in_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (palette_dialog_zoomin_callback),
(gpointer) palette);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
button = gtk_button_new ();
button = gimp_pixmap_button_new (zoom_out_xpm);
gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
pixmap = gdk_pixmap_create_from_xpm_d (palette->shell->window, &mask,
&style->bg[GTK_STATE_NORMAL],
zoom_out_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (palette_dialog_zoomout_callback),
(gpointer) palette);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
/* clist preview of palettes */
......@@ -2318,6 +2296,8 @@ palette_dialog_new (gint vert)
gtk_widget_show (button);
}
gtk_widget_realize (palette->shell);
palette->gc = gdk_gc_new (palette->shell->window);
/* fill the clist */
......
......@@ -1066,41 +1066,26 @@ zoom_adj_changed (GtkAdjustment *adj,
static GtkWidget *
nav_create_button_area (InfoDialog *info_win)
{
GtkWidget *hbox1;
GtkWidget *vbox1;
GtkWidget *button;
GtkWidget *hscale1;
GtkWidget *label1;
GtkObject *adjustment;
GdkPixmap *pixmap;
GtkWidget *pixmapwid;
GdkBitmap *mask;
GtkStyle *style;
GtkWidget *hbox1;
GtkWidget *vbox1;
GtkWidget *button;
GtkWidget *hscale1;
GtkWidget *label1;
GtkObject *adjustment;
NavWinData *iwd;
gchar scale_str[MAX_SCALE_BUF];
gchar scale_str[MAX_SCALE_BUF];
iwd = (NavWinData *)info_win->user_data;
iwd = (NavWinData *) info_win->user_data;
hbox1 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox1);
style = gtk_widget_get_style (info_win->shell);
button = gtk_button_new ();
button = gimp_pixmap_button_new (zoom_out_xpm);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (navwindow_zoomout), (gpointer) info_win->user_data);
GTK_SIGNAL_FUNC (navwindow_zoomout),
(gpointer) info_win->user_data);
gtk_box_pack_start (GTK_BOX (hbox1), button, FALSE, FALSE, 0);
pixmap = gdk_pixmap_create_from_xpm_d (info_win->shell->window, &mask,
&style->bg[GTK_STATE_NORMAL],
zoom_out_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
vbox1 = gtk_vbox_new (FALSE, 0);
......@@ -1130,21 +1115,12 @@ nav_create_button_area (InfoDialog *info_win)
gtk_box_pack_start (GTK_BOX (vbox1), hscale1, TRUE, TRUE, 0);
gtk_scale_set_draw_value (GTK_SCALE (hscale1), FALSE);
button = gtk_button_new ();
button = gimp_pixmap_button_new (zoom_in_xpm);
GTK_WIDGET_UNSET_FLAGS (button, GTK_RECEIVES_DEFAULT);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (navwindow_zoomin), (gpointer) info_win->user_data);
GTK_SIGNAL_FUNC (navwindow_zoomin),
(gpointer) info_win->user_data);
gtk_box_pack_start (GTK_BOX (hbox1), button, FALSE, FALSE, 0);
pixmap = gdk_pixmap_create_from_xpm_d (info_win->shell->window, &mask,
&style->bg[GTK_STATE_NORMAL],
zoom_in_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
return vbox1;
......
......@@ -2056,10 +2056,6 @@ palette_dialog_new (gint vert)
GtkWidget *alignment;
GtkWidget *frame;
GtkWidget *button;
GtkWidget *pixmapwid;
GdkPixmap *pixmap;
GdkBitmap *mask;
GtkStyle *style;
gchar *titles[3];
palette = g_new (PaletteDialog, 1);
......@@ -2190,36 +2186,18 @@ palette_dialog_new (gint vert)
palette);
/* + and - buttons */
if (! GTK_WIDGET_REALIZED (palette->shell))
gtk_widget_realize (palette->shell);
style = gtk_widget_get_style (palette->shell);
button = gtk_button_new ();
button = gimp_pixmap_button_new (zoom_in_xpm);
gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
pixmap = gdk_pixmap_create_from_xpm_d (palette->shell->window, &mask,
&style->bg[GTK_STATE_NORMAL],
zoom_in_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (palette_dialog_zoomin_callback),
(gpointer) palette);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
button = gtk_button_new ();
button = gimp_pixmap_button_new (zoom_out_xpm);
gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
pixmap = gdk_pixmap_create_from_xpm_d (palette->shell->window, &mask,
&style->bg[GTK_STATE_NORMAL],
zoom_out_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (palette_dialog_zoomout_callback),
(gpointer) palette);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
/* clist preview of palettes */
......@@ -2318,6 +2296,8 @@ palette_dialog_new (gint vert)
gtk_widget_show (button);
}
gtk_widget_realize (palette->shell);
palette->gc = gdk_gc_new (palette->shell->window);
/* fill the clist */
......
......@@ -759,21 +759,17 @@ gradient_get_color_at (gradient_t *gradient,
void
gradient_editor_create (void)
{
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *gvbox;
GtkWidget *button;
GtkWidget *frame;
GtkWidget *scrolled_win;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *gvbox;
GtkWidget *button;
GtkWidget *frame;
GtkWidget *scrolled_win;
GdkColormap *colormap;
GtkWidget *pixmapwid;
GdkPixmap *pixmap;
GdkBitmap *mask;
GtkStyle *style;
gchar *titles[2];
gint column_width;
gint select_pos;
gint i;
gchar *titles[2];
gint column_width;
gint select_pos;
gint i;
/* If the editor already exists, just show it */
if (g_editor)
......@@ -934,42 +930,21 @@ gradient_editor_create (void)