[gtkada] Value in Gtk_Tree_Store modified by GtkAda ?
Rob Groen
robgr at xs4all.nl
Fri Mar 11 11:21:48 CET 2016
Hello,
When I create a Gtk_Tree_Model_Filter without a child model, i.e. using
Null_Gtk_Tree_Model as child, then
I get a non-null object (and also a textual message in a terminal
window).
Now when I store that non-null object in a Gtk_Tree_Store and then
retrieve it I get a null value. Is that OK? I can't find something about
this behaviour in the documentation. Below is a small sample program to
repeat this behaviour.
I am using GPL 2014 and GtkAda 2015 on Windows 7
Regards, Rob
Sample program
with Ada.Text_Io; use Ada.Text_Io;
with Glib.Object; use Glib.Object;
with Gtk.Main;
with Gtk.Tree_Model; use Gtk.Tree_Model;
with Gtk.Tree_Store; use Gtk.Tree_Store;
with Gtk.Tree_Model_Filter; use Gtk.Tree_Model_Filter;
procedure Test_Model_Filter_Main is
Mf : Gtk_Tree_Model_Filter;
Obj : Gobject;
Store : Gtk_Tree_Store;
Iter : Gtk_Tree_Iter;
begin
Gtk.Main.Init;
Gtk_New (Mf, Null_Gtk_Tree_Model);
Obj := Gobject (Mf);
if Obj = null then
Put_Line ("null object returned");
return;
end if;
Gtk_New (Store, (1 => Glib.Gtype_Object));
Store.Append (Iter, Null_Iter);
Store.Set (Iter, 0, Obj);
Obj := Store.Get_Object (Iter, 0);
if Obj = null then
Put_Line ("object is now null");
end if;
end Test_Model_Filter_Main;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/gtkada/attachments/20160311/4628d515/attachment.html>
More information about the gtkada
mailing list