[gtkada] Problem with Gtk_About_Dialog

Emmanuel Briot briot at adacore.com
Fri Apr 11 17:22:25 CEST 2014


> I am using a Gtk_About_Dialog under version gtkada-3.4.2-gpl in Linux. When I click on the "License" button I get the following error message:
> 
> (testgtk:3413): GLib-GObject-WARNING **: g_object_set_valist: object class 'GtkTextTag' has no property named 'font-scale'
> 
> (testgtk:3413): Gtk-CRITICAL **: gtk_text_buffer_apply_tag: assertion 'tag->priv->table == buffer->priv->tag_table' failed
> 
> The same happens in testgtk. Is this a known problem?

Not a known problem, but I can indeed reproduce it with the current development version
of testgtk.

Looking at the gtk+ source, it seems this might have been fixed on Jul 8, 2013 with the
following patch:



commit 50c3eb9accf7665e51820f7f95870f6280777dde
Author: Matthias Clasen <mclasen at redhat.com>
Date:   Mon Jul 8 21:46:43 2013 -0400

    Fix the small text for text in GtkAboutDialog

    The conversion from gtk_widget_override_font to a GtkTextTag
    in fbbb66ae7d19516b7a99de3d8b0a96164fb3ead2 was defective.

    https://bugzilla.gnome.org/show_bug.cgi?id=701119

diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c
index 514719c..992b868 100644
--- a/gtk/gtkaboutdialog.c
+++ b/gtk/gtkaboutdialog.c
@@ -2036,12 +2036,6 @@ text_buffer_new (GtkAboutDialog  *about,

   buffer = gtk_text_buffer_new (NULL);

-  gtk_text_buffer_get_start_iter (buffer, &start_iter);
-  gtk_text_buffer_get_start_iter (buffer, &end_iter);
-  tag = gtk_text_tag_new (NULL);
-  g_object_set (tag, "font-scale", PANGO_SCALE_SMALL, NULL);
-  gtk_text_buffer_apply_tag (buffer, tag, &start_iter, &end_iter);
-
   for (p = strings; *p; p++)
     {
       q0  = *p;
@@ -2128,6 +2122,14 @@ text_buffer_new (GtkAboutDialog  *about,
         gtk_text_buffer_insert_at_cursor (buffer, "\n", 1);
     }

+  tag = gtk_text_buffer_create_tag (buffer, NULL,
+                                    "scale", PANGO_SCALE_SMALL,
+                                    NULL);
+
+  gtk_text_buffer_get_start_iter (buffer, &start_iter);
+  gtk_text_buffer_get_end_iter (buffer, &end_iter);
+  gtk_text_buffer_apply_tag (buffer, tag, &start_iter, &end_iter);
+
   return buffer;
 }


Emmanuel


More information about the gtkada mailing list