[PATCH 3/3] Don't use g_object_set on initialized objects.

David Shea dshea at redhat.com
Fri Oct 11 19:53:31 UTC 2013


Set object properties using the provided setters to avoid causing
problems. Setting "xalign" this way in the LayoutIndicator was producing
some uninitialized value errors, and might as well do the same with
"expand" in BaseWindow to be safe.
---
 widgets/src/BaseWindow.c      | 3 ++-
 widgets/src/LayoutIndicator.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/widgets/src/BaseWindow.c b/widgets/src/BaseWindow.c
index bc7dfa9..89e50e8 100644
--- a/widgets/src/BaseWindow.c
+++ b/widgets/src/BaseWindow.c
@@ -207,7 +207,8 @@ static void anaconda_base_window_init(AnacondaBaseWindow *win) {
     /* Set properties on the parent (Gtk.Window) class. */
     gtk_window_set_decorated(GTK_WINDOW(win), FALSE);
     gtk_window_maximize(GTK_WINDOW(win));
-    g_object_set(win, "expand", TRUE, NULL);
+    gtk_widget_set_hexpand(GTK_WIDGET(win), TRUE);
+    gtk_widget_set_vexpand(GTK_WIDGET(win), TRUE);
     gtk_container_set_border_width(GTK_CONTAINER(win), 0);
 
     /* First, construct a top-level box that everything will go in.  Remember
diff --git a/widgets/src/LayoutIndicator.c b/widgets/src/LayoutIndicator.c
index cafcef8..2a44560 100644
--- a/widgets/src/LayoutIndicator.c
+++ b/widgets/src/LayoutIndicator.c
@@ -211,7 +211,7 @@ static void anaconda_layout_indicator_init(AnacondaLayoutIndicator *self) {
     gtk_label_set_max_width_chars(self->priv->layout_label, DEFAULT_LABEL_MAX_CHAR_WIDTH);
     gtk_label_set_width_chars(self->priv->layout_label, DEFAULT_LABEL_MAX_CHAR_WIDTH);
     gtk_label_set_ellipsize(self->priv->layout_label, PANGO_ELLIPSIZE_END);
-    g_object_set(G_OBJECT(self->priv->layout_label), "xalign", 0, NULL);
+    gtk_misc_set_alignment(GTK_MISC(self->priv->layout_label), 0.0, 0.5);
 
     /* initialize the label with the current layout name */
     anaconda_layout_indicator_refresh_ui_elements(self);
-- 
1.8.3.1



More information about the anaconda-patches mailing list