[gcalctool] Fix scary error message on startup
- From: Robin Sonefors <rsonefors src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcalctool] Fix scary error message on startup
- Date: Mon, 11 Oct 2010 00:01:44 +0000 (UTC)
commit 94bd301cd3a8fefa9c2b851bd2e95a9afb07be44
Author: Robin Sonefors <ozamosi flukkost nu>
Date: Mon Oct 11 02:01:12 2010 +0200
Fix scary error message on startup
src/math-equation.c | 17 +++++++++++++----
src/math-equation.h | 2 ++
2 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/src/math-equation.c b/src/math-equation.c
index 4481745..08f95e4 100644
--- a/src/math-equation.c
+++ b/src/math-equation.c
@@ -1223,6 +1223,18 @@ math_equation_get_property(GObject *object,
}
}
+static void
+math_equation_constructed (GObject *object)
+{
+ GtkTextBuffer *parent_class;
+ parent_class = g_type_class_peek_parent(MATH_EQUATION_GET_CLASS(object));
+ if (G_OBJECT_CLASS(parent_class)->constructed)
+ G_OBJECT_CLASS(parent_class)->constructed(object);
+
+ MATH_EQUATION(object)->priv->ans_tag = gtk_text_buffer_create_tag(GTK_TEXT_BUFFER(object), NULL, "weight", PANGO_WEIGHT_BOLD, NULL);
+}
+
+
static void
math_equation_class_init (MathEquationClass *klass)
@@ -1245,6 +1257,7 @@ math_equation_class_init (MathEquationClass *klass)
object_class->get_property = math_equation_get_property;
object_class->set_property = math_equation_set_property;
+ object_class->constructed = math_equation_constructed;
g_type_class_add_private (klass, sizeof (MathEquationPrivate));
@@ -1485,10 +1498,6 @@ math_equation_init(MathEquation *equation)
equation->priv = G_TYPE_INSTANCE_GET_PRIVATE (equation, math_equation_get_type(), MathEquationPrivate);
- // FIXME: Causes error
- // (process:18573): Gtk-CRITICAL **: set_table: assertion buffer->tag_table == NULL' failed
- equation->priv->ans_tag = gtk_text_buffer_create_tag(GTK_TEXT_BUFFER(equation), NULL, "weight", PANGO_WEIGHT_BOLD, NULL);
-
g_signal_connect(equation, "insert-text", G_CALLBACK(pre_insert_text_cb), equation);
g_signal_connect(equation, "delete-range", G_CALLBACK(pre_delete_range_cb), equation);
g_signal_connect_after(equation, "insert-text", G_CALLBACK(insert_text_cb), equation);
diff --git a/src/math-equation.h b/src/math-equation.h
index bd6d54c..fbba59c 100644
--- a/src/math-equation.h
+++ b/src/math-equation.h
@@ -28,7 +28,9 @@
G_BEGIN_DECLS
+#define MATH_TYPE_EQUATION (math_equation_get_type ())
#define MATH_EQUATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), math_equation_get_type(), MathEquation))
+#define MATH_EQUATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MATH_TYPE_EQUATION, MathEquationClass))
typedef struct MathEquationPrivate MathEquationPrivate;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]