[gtkada] Is Gfloat properties working?

Maxim Reznik max1 at mbank.com.ua
Fri Aug 29 07:48:05 CEST 2003


Hi All,

I need control "xalign" property of Gtk_Tree_View_Cell_Renderer to
align column in Gtk_Tree_View. But it seems there is a probleem here.
When I try something like:

with Ada.Text_IO;            use Ada.Text_IO;
with Gtk.Main;
with Gtk.Alignment;
with Glib.Properties;        use Glib.Properties;
with Gtk.Cell_Renderer_Text; use Gtk.Cell_Renderer_Text;

procedure Gfloat_Test is
    Renderer : Gtk_Cell_Renderer_Text;
begin
    Gtk.Main.Init;

    Gtk_New (Renderer);
    Put_Line (
      Get_Property (Renderer, Gtk.Alignment.Xalign_Property)'Img);
    Set_Property (Renderer, Gtk.Alignment.Xalign_Property, 0.5);
end Gfloat_Test;

On Get_Property I get:

(gfloat_test:1674): GLib-GObject-CRITICAL **: file gvaluetypes.c: line 
715 (g_value_get_float): assertion `G_VALUE_HOLDS_FLOAT (value)' failed

But Set_Property crashed my application at all.
I tried GtkAda-2.2.0 under Linux and Windows with the same result.

I rewrite Get/Set_Property using GValue and "g_object_g/set_property"
It works well.
If you like I could write a patch for glib-properties.adb.

Maxim




More information about the gtkada mailing list