From 93e1585614b72c684b4fa302f6ae2e6d5605e02e Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Sun, 29 Mar 1998 02:44:43 +0000 Subject: [PATCH] Disconnect from combo->entry, not combo. (From: Daniel Skarda Sat Mar 28 21:18:42 1998 Owen Taylor * gtk/gtkcombo.c (gtk_combo_disable_activate): Disconnect from combo->entry, not combo. (From: Daniel Skarda <0rfelyus@atrey.karlin.mff.cuni.cz>) * gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpm): Deal better with xpm's with bad colors in them. Plus, 3rd attempt to commit gtklabel changes --- ChangeLog | 9 +++++++++ ChangeLog.pre-2-0 | 9 +++++++++ ChangeLog.pre-2-10 | 9 +++++++++ ChangeLog.pre-2-2 | 9 +++++++++ ChangeLog.pre-2-4 | 9 +++++++++ ChangeLog.pre-2-6 | 9 +++++++++ ChangeLog.pre-2-8 | 9 +++++++++ gdk/gdkpixmap.c | 10 ++++++++-- gdk/x11/gdkpixmap-x11.c | 10 ++++++++-- gtk/gtkcombo.c | 2 +- gtk/gtklabel.c | 34 +++++++++++++++++++++++++++++++--- 11 files changed, 111 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index f4c1217029..6312936fc3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Sat Mar 28 21:18:42 1998 Owen Taylor + + * gtk/gtkcombo.c (gtk_combo_disable_activate): + Disconnect from combo->entry, not combo. + (From: Daniel Skarda <0rfelyus@atrey.karlin.mff.cuni.cz>) + + * gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpm): Deal + better with xpm's with bad colors in them. + Fri Mar 27 21:01:17 1998 Owen Taylor * gdk/gdk.c (gdk_event_translate): Don't call diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index f4c1217029..6312936fc3 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,12 @@ +Sat Mar 28 21:18:42 1998 Owen Taylor + + * gtk/gtkcombo.c (gtk_combo_disable_activate): + Disconnect from combo->entry, not combo. + (From: Daniel Skarda <0rfelyus@atrey.karlin.mff.cuni.cz>) + + * gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpm): Deal + better with xpm's with bad colors in them. + Fri Mar 27 21:01:17 1998 Owen Taylor * gdk/gdk.c (gdk_event_translate): Don't call diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index f4c1217029..6312936fc3 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +Sat Mar 28 21:18:42 1998 Owen Taylor + + * gtk/gtkcombo.c (gtk_combo_disable_activate): + Disconnect from combo->entry, not combo. + (From: Daniel Skarda <0rfelyus@atrey.karlin.mff.cuni.cz>) + + * gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpm): Deal + better with xpm's with bad colors in them. + Fri Mar 27 21:01:17 1998 Owen Taylor * gdk/gdk.c (gdk_event_translate): Don't call diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index f4c1217029..6312936fc3 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,12 @@ +Sat Mar 28 21:18:42 1998 Owen Taylor + + * gtk/gtkcombo.c (gtk_combo_disable_activate): + Disconnect from combo->entry, not combo. + (From: Daniel Skarda <0rfelyus@atrey.karlin.mff.cuni.cz>) + + * gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpm): Deal + better with xpm's with bad colors in them. + Fri Mar 27 21:01:17 1998 Owen Taylor * gdk/gdk.c (gdk_event_translate): Don't call diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index f4c1217029..6312936fc3 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +Sat Mar 28 21:18:42 1998 Owen Taylor + + * gtk/gtkcombo.c (gtk_combo_disable_activate): + Disconnect from combo->entry, not combo. + (From: Daniel Skarda <0rfelyus@atrey.karlin.mff.cuni.cz>) + + * gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpm): Deal + better with xpm's with bad colors in them. + Fri Mar 27 21:01:17 1998 Owen Taylor * gdk/gdk.c (gdk_event_translate): Don't call diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index f4c1217029..6312936fc3 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +Sat Mar 28 21:18:42 1998 Owen Taylor + + * gtk/gtkcombo.c (gtk_combo_disable_activate): + Disconnect from combo->entry, not combo. + (From: Daniel Skarda <0rfelyus@atrey.karlin.mff.cuni.cz>) + + * gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpm): Deal + better with xpm's with bad colors in them. + Fri Mar 27 21:01:17 1998 Owen Taylor * gdk/gdk.c (gdk_event_translate): Don't call diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index f4c1217029..6312936fc3 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +Sat Mar 28 21:18:42 1998 Owen Taylor + + * gtk/gtkcombo.c (gtk_combo_disable_activate): + Disconnect from combo->entry, not combo. + (From: Daniel Skarda <0rfelyus@atrey.karlin.mff.cuni.cz>) + + * gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpm): Deal + better with xpm's with bad colors in them. + Fri Mar 27 21:01:17 1998 Owen Taylor * gdk/gdk.c (gdk_event_translate): Don't call diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c index 6fbdada880..1ec059cda1 100644 --- a/gdk/gdkpixmap.c +++ b/gdk/gdkpixmap.c @@ -473,7 +473,7 @@ gdk_pixmap_colormap_create_from_xpm (GdkWindow *window, color = NULL; ns = 0; - while (color == NULL) + while ((color == NULL) && (ns < num_cols)) { if (strcmp (pixel_str, colors[ns].color_string) == 0) color = &colors[ns]; @@ -481,6 +481,9 @@ gdk_pixmap_colormap_create_from_xpm (GdkWindow *window, ns++; } + if (!color) /* screwed up XPM file */ + color = &colors[0]; + gdk_image_put_pixel (image, xcnt, ycnt, color->color.pixel); if (mask && color->transparent) @@ -643,7 +646,7 @@ gdk_pixmap_colormap_create_from_xpm_d (GdkWindow *window, color = NULL; ns = 0; - while (color == NULL) + while ((color == NULL) && (ns < num_cols)) { if (strcmp (pixel_str, colors[ns].color_string) == 0) color = &colors[ns]; @@ -651,6 +654,9 @@ gdk_pixmap_colormap_create_from_xpm_d (GdkWindow *window, ns++; } + if (!color) /* screwed up XPM file */ + color = &colors[0]; + gdk_image_put_pixel (image, xcnt, ycnt, color->color.pixel); if (mask && color->transparent) diff --git a/gdk/x11/gdkpixmap-x11.c b/gdk/x11/gdkpixmap-x11.c index 6fbdada880..1ec059cda1 100644 --- a/gdk/x11/gdkpixmap-x11.c +++ b/gdk/x11/gdkpixmap-x11.c @@ -473,7 +473,7 @@ gdk_pixmap_colormap_create_from_xpm (GdkWindow *window, color = NULL; ns = 0; - while (color == NULL) + while ((color == NULL) && (ns < num_cols)) { if (strcmp (pixel_str, colors[ns].color_string) == 0) color = &colors[ns]; @@ -481,6 +481,9 @@ gdk_pixmap_colormap_create_from_xpm (GdkWindow *window, ns++; } + if (!color) /* screwed up XPM file */ + color = &colors[0]; + gdk_image_put_pixel (image, xcnt, ycnt, color->color.pixel); if (mask && color->transparent) @@ -643,7 +646,7 @@ gdk_pixmap_colormap_create_from_xpm_d (GdkWindow *window, color = NULL; ns = 0; - while (color == NULL) + while ((color == NULL) && (ns < num_cols)) { if (strcmp (pixel_str, colors[ns].color_string) == 0) color = &colors[ns]; @@ -651,6 +654,9 @@ gdk_pixmap_colormap_create_from_xpm_d (GdkWindow *window, ns++; } + if (!color) /* screwed up XPM file */ + color = &colors[0]; + gdk_image_put_pixel (image, xcnt, ycnt, color->color.pixel); if (mask && color->transparent) diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c index 05e510293d..be34621167 100644 --- a/gtk/gtkcombo.c +++ b/gtk/gtkcombo.c @@ -679,7 +679,7 @@ gtk_combo_disable_activate (GtkCombo* combo) g_return_if_fail (GTK_IS_COMBO (combo)); if ( combo->activate_id ) { - gtk_signal_disconnect(GTK_OBJECT(combo), combo->activate_id); + gtk_signal_disconnect(GTK_OBJECT(combo->entry), combo->activate_id); combo->activate_id = 0; } } diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 694f9620a8..0f30935ce7 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -38,6 +38,11 @@ static void gtk_label_size_request (GtkWidget *widget, GtkRequisition *requisition); static gint gtk_label_expose (GtkWidget *widget, GdkEventExpose *event); +static void gtk_label_state_changed (GtkWidget *widget, + guint previous_state); +static void gtk_label_style_set (GtkWidget *widget, + GtkStyle *previous_style); + static GtkMiscClass *parent_class = NULL; @@ -85,6 +90,8 @@ gtk_label_class_init (GtkLabelClass *class) widget_class->size_request = gtk_label_size_request; widget_class->expose_event = gtk_label_expose; + widget_class->style_set = gtk_label_style_set; + widget_class->state_changed = gtk_label_state_changed; } static void @@ -365,7 +372,28 @@ gtk_label_expose (GtkWidget *widget, return TRUE; } +static void +gtk_label_state_changed (GtkWidget *widget, + guint previous_state) +{ + if (GTK_WIDGET_NO_WINDOW (widget) && + GTK_WIDGET_DRAWABLE (widget)) + gdk_window_clear_area (widget->window, + widget->allocation.x, + widget->allocation.y, + widget->allocation.width, + widget->allocation.height); +} - - - +static void +gtk_label_style_set (GtkWidget *widget, + GtkStyle *previous_style) +{ + if (GTK_WIDGET_NO_WINDOW (widget) && + GTK_WIDGET_DRAWABLE (widget)) + gdk_window_clear_area (widget->window, + widget->allocation.x, + widget->allocation.y, + widget->allocation.width, + widget->allocation.height); +}