[gtkada] Examples/tooltips/tooltips.adb CONSTRAINT_ERROR

Pascal p.p14 at orange.fr
Fri Sep 7 22:13:50 CEST 2012


Hello,

I've got an exception CONSTRAINT_ERROR with tooltips example from GTKAda with line Column.Get_Widget.Set_Tooltip_Text ("Header");
GTKAda GPL 2012 built on MacOS 10.6 with GNAT GPL 2012 for Darwin x86_64.

When I removed this line as in following patch, all is getting well.

--- ./examples/tooltips/tooltips.adb.0	2012-05-18 10:04:22.000000000 +0200
+++ ./examples/tooltips/tooltips.adb	2012-07-25 10:11:41.000000000 +0200
@@ -300,7 +300,9 @@
    Window.Realize;
 
    Column.Set_Clickable (True);
-   Column.Get_Widget.Set_Tooltip_Text ("Header");
+   --  Column.Get_Widget.Set_Tooltip_Text ("Header");
+   --  Previous line commented out to avoid:
+   --  raised CONSTRAINT_ERROR : tooltips.adb:303 access check failed
 
    Gtk.Window.Show_All (Window);
    Gtk.Main.Main;

GDB session is:
(gdb) bt
#0  gtk_tree_view_column_get_widget (tree_column=0x1018d2830)
    at gtktreeviewcolumn.c:2284
#1  0x000000010007101a in gtk.tree_view_column.get_widget (
    tree_column=0x101629120, <tree_columnL>=0)
    at /usr/local/src-2012/gtkada-2.24.2-src/src/gtk-tree_view_column.adb:642
#2  0x0000000100004037 in tooltips ()
    at tooltips.adb:307
(gdb) l
2279     *     header, or %NULL
2280     **/
2281    GtkWidget *
2282    gtk_tree_view_column_get_widget (GtkTreeViewColumn *tree_column)
2283    {
2284      g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), NULL);
2285    
2286      return tree_column->child;
2287    }
2288    
(gdb) p tree_column
$1 = (GtkTreeViewColumn *) 0x1018d2830
(gdb) p *tree_column
$6 = {parent = {parent_instance = {g_type_instance = {g_class = 0x10162ef90}, 
      ref_count = 1, qdata = 0x10162c980}, flags = 0}, 
  tree_view = 0x1018d0160, button = 0x1018d28f0, child = 0x0, 
  arrow = 0x1018ae8a0, alignment = 0x1018d8810, window = 0x0, 
  editable_widget = 0x0, xalign = 0, property_changed_signal = 28, 
  spacing = 0, column_type = GTK_TREE_VIEW_COLUMN_GROW_ONLY, 
  requested_width = -1, button_request = 0, resized_width = 0, width = 0, 
  fixed_width = 1, min_width = -1, max_width = -1, drag_x = 0, drag_y = 0, 
  title = 0x1016311d0 "Test", cell_list = 0x10162c400, 
  sort_clicked_signal = 0, sort_column_changed_signal = 0, 
  sort_column_id = -1, sort_order = GTK_SORT_ASCENDING, visible = 1, 
  resizable = 0, clickable = 1, dirty = 1, show_sort_indicator = 0, 
  maybe_reordered = 0, reorderable = 0, use_resized_width = 0, expand = 0}
(gdb) p tree_column.child 
$2 = (GtkWidget *) 0x0

Any idea why child is null?
Is it reproducible on other platform?

Thanks, Pascal.
http://blady.pagesperso-orange.fr




More information about the gtkada mailing list