summaryrefslogtreecommitdiff
path: root/gtk/gtkcolorsel.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>1999-01-26 01:15:47 +0000
committerOwen Taylor <otaylor@src.gnome.org>1999-01-26 01:15:47 +0000
commitdf403d5908f398a729671b295abc3948d047b658 (patch)
tree1c1a1e284cf0d9f185b8565722269172d36b5bf6 /gtk/gtkcolorsel.c
parent65dd58ffa32006f6d3f76a822d632796160a3d65 (diff)
downloadgdk-pixbuf-df403d5908f398a729671b295abc3948d047b658.tar.gz
New functions to set the colormap or visual of an existing widget. These
Mon Jan 25 20:05:22 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c (gtk_widget_set_{visual,colormap}): New functions to set the colormap or visual of an existing widget. These functions should not be called on a widget that has previosly been realized. * gtk/gtkcolorsel.c (gtk_color_selection_dialog_init): Set the visual and colormap on the toplevel dialog, then push them for the child widgets. As opposed to push/pop in _new(), this way, things will work properly with gtk_widget_new().
Diffstat (limited to 'gtk/gtkcolorsel.c')
-rw-r--r--gtk/gtkcolorsel.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gtk/gtkcolorsel.c b/gtk/gtkcolorsel.c
index 79618e74d..a7240a66e 100644
--- a/gtk/gtkcolorsel.c
+++ b/gtk/gtkcolorsel.c
@@ -1615,6 +1615,12 @@ gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
{
GtkWidget *action_area, *frame;
+ gtk_widget_set_visual (GTK_WIDGET (colorseldiag), gdk_rgb_get_visual ());
+ gtk_widget_set_colormap (GTK_WIDGET (colorseldiag), gdk_rgb_get_cmap ());
+
+ gtk_widget_push_visual (gdk_rgb_get_visual ());
+ gtk_widget_push_colormap (gdk_rgb_get_cmap ());
+
colorseldiag->main_vbox = gtk_vbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (colorseldiag), 10);
gtk_container_add (GTK_CONTAINER (colorseldiag), colorseldiag->main_vbox);
@@ -1650,6 +1656,9 @@ gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
GTK_WIDGET_SET_FLAGS (colorseldiag->help_button, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (action_area), colorseldiag->help_button, TRUE, TRUE, 0);
gtk_widget_show (colorseldiag->help_button);
+
+ gtk_widget_pop_colormap ();
+ gtk_widget_pop_visual ();
}
GtkWidget *
@@ -1657,14 +1666,8 @@ gtk_color_selection_dialog_new (const gchar *title)
{
GtkColorSelectionDialog *colorseldiag;
- gtk_widget_push_visual (gdk_rgb_get_visual ());
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
-
colorseldiag = gtk_type_new (gtk_color_selection_dialog_get_type ());
gtk_window_set_title (GTK_WINDOW (colorseldiag), title);
- gtk_widget_pop_colormap ();
- gtk_widget_pop_visual ();
-
return GTK_WIDGET (colorseldiag);
}