another druid bug
- From: jacob berkman <jacob ximian com>
- To: desktop-devel-list <desktop-devel-list gnome org>
- Cc: gnome-libs-devel gnome org
- Subject: another druid bug
- Date: 08 Jan 2002 18:21:34 -0500
if someone wants to fix this bug i would appreciate it.
http://primates.ximian.com/~jacob/gnome2/bad-druid.png
the green rectange at the top should be red.
you can get this by applying the attached patch to libgnomeui, the make,
and run test-gnome/test-druid.
if not i'll work on it tomorrow...
jacob
--
"In fact, can you imagine anything more terrifying than a zombie clown?"
-- moby
Index: libgnomeui/gnome-druid-page-standard.c
===================================================================
RCS file: /cvs/gnome/libgnomeui/libgnomeui/gnome-druid-page-standard.c,v
retrieving revision 1.38
diff -u -r1.38 gnome-druid-page-standard.c
--- libgnomeui/gnome-druid-page-standard.c 2001/12/27 01:27:07 1.38
+++ libgnomeui/gnome-druid-page-standard.c 2002/01/08 23:24:35
@@ -74,8 +74,6 @@
GtkStyle *old_style);
static void gnome_druid_page_standard_prepare (GnomeDruidPage *page,
GtkWidget *druid);
-static void gnome_druid_page_standard_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation);
static void gnome_druid_page_standard_layout_setup (GnomeDruidPageStandard *druid_page_standard);
static void gnome_druid_page_standard_set_color (GnomeDruidPageStandard *druid_page_standard);
@@ -122,7 +120,6 @@
gobject_class->set_property = gnome_druid_page_standard_set_property;
gobject_class->finalize = gnome_druid_page_standard_finalize;
object_class->destroy = gnome_druid_page_standard_destroy;
- widget_class->size_allocate = gnome_druid_page_standard_size_allocate;
widget_class->realize = gnome_druid_page_standard_realize;
widget_class->style_set = gnome_druid_page_standard_style_set;
druid_page_class->prepare = gnome_druid_page_standard_prepare;
@@ -307,17 +304,6 @@
}
static void
-get_color_arg (GValue *value, GdkColor *orig)
-{
- GdkColor *color;
-
- color = g_new (GdkColor, 1);
- *color = *orig;
- g_value_init (value, GDK_TYPE_COLOR);
- g_value_set_boxed (value, color);
-}
-
-static void
gnome_druid_page_standard_get_property (GObject *object,
guint prop_id,
GValue *value,
@@ -336,25 +322,25 @@
g_value_set_object (value, druid_page_standard->top_watermark);
break;
case PROP_TITLE_FOREGROUND_GDK:
- get_color_arg (value, & (druid_page_standard->title_foreground));
+ g_value_set_boxed (value, &druid_page_standard->title_foreground);
break;
case PROP_TITLE_FOREGROUND_SET:
g_value_set_boolean (value, druid_page_standard->_priv->title_foreground_set);
break;
case PROP_BACKGROUND_GDK:
- get_color_arg (value, & (druid_page_standard->background));
+ g_value_set_boxed (value, &druid_page_standard->background);
break;
case PROP_BACKGROUND_SET:
g_value_set_boolean (value, druid_page_standard->_priv->background_set);
break;
case PROP_LOGO_BACKGROUND_GDK:
- get_color_arg (value, & (druid_page_standard->logo_background));
+ g_value_set_boxed (value, &druid_page_standard->logo_background);
break;
case PROP_LOGO_BACKGROUND_SET:
g_value_set_boolean (value, druid_page_standard->_priv->logo_background_set);
break;
case PROP_CONTENTS_BACKGROUND_GDK:
- get_color_arg (value, & (druid_page_standard->contents_background));
+ g_value_set_boxed (value, &druid_page_standard->contents_background);
break;
case PROP_CONTENTS_BACKGROUND_SET:
g_value_set_boolean (value, druid_page_standard->_priv->contents_background_set);
@@ -363,8 +349,6 @@
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
-
- GNOME_CALL_PARENT (G_OBJECT_CLASS, get_property, (object, prop_id, value, pspec));
}
static void
@@ -460,8 +444,6 @@
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
-
- GNOME_CALL_PARENT (G_OBJECT_CLASS, set_property, (object, prop_id, value, pspec));
}
static void
@@ -777,15 +759,6 @@
gtk_box_pack_start (GTK_BOX (vbox), a_label, FALSE, FALSE, 0);
gtk_widget_show (a_label);
}
-}
-
-static void
-gnome_druid_page_standard_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation)
-{
- GNOME_CALL_PARENT (GTK_WIDGET_CLASS, size_allocate,
- (widget, allocation));
- gnome_druid_page_standard_layout_setup (GNOME_DRUID_PAGE_STANDARD (widget));
}
static void
Index: test-gnome/testdruid.c
===================================================================
RCS file: /cvs/gnome/libgnomeui/test-gnome/testdruid.c,v
retrieving revision 1.2
diff -u -r1.2 testdruid.c
--- test-gnome/testdruid.c 2001/08/25 20:29:29 1.2
+++ test-gnome/testdruid.c 2002/01/08 23:24:35
@@ -16,12 +16,16 @@
GtkWidget *window;
GtkWidget *druid;
GtkWidget *druid_page;
+
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
druid = gnome_druid_new ();
gtk_container_add (GTK_CONTAINER (window), druid);
druid_page = gnome_druid_page_standard_new_with_vals ("Test Druid", NULL, NULL);
+ g_object_set (G_OBJECT (druid_page),
+ "background", "green4",
+ NULL);
gnome_druid_append_page (GNOME_DRUID (druid), GNOME_DRUID_PAGE (druid_page));
gnome_druid_page_standard_append_item (GNOME_DRUID_PAGE_STANDARD (druid_page),
"Test _one:",
@@ -40,6 +44,9 @@
gtk_entry_new (),
"Longer information here");
gtk_widget_show_all (window);
+ g_object_set (G_OBJECT (druid_page),
+ "background", "red4",
+ NULL);
gtk_main ();
return 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]