[gtkada] set_property to a tag to justify text

Alessandro Iavicoli alessandro.iavicoli at gmail.com
Sat Apr 20 10:23:33 CEST 2013


Hello,

I'm developing a simple notepad using gtkada.
I need to set a property to a text_tag to justify left/center/right a
paragraph (not the whole text in the text_area, just to a paragraph)
My code is:
Tag := Buffer.Create_Tag ("jus_center");
Set_Property (Tag,
    Gtk.Text_Tag.Justification_Property,
    Gtk.Enums.Justify_Center);

but it doesn't compile giving me this error:

no candidate interpretations match the actuals:
programenvironment.adb:46:33: expected private type
"Property_Font_Description" defined at pango-font.ads:265
programenvironment.adb:46:33: found private type "Property_Boolean" defined
at glib-properties.ads:117
programenvironment.adb:46:33:   ==> in call to inherited operation
"Set_Property" at pango-font.ads:265
programenvironment.adb:46:33:   ==> in call to inherited operation
"Set_Property" at pango-enums.ads:171
programenvironment.adb:46:33:   ==> in call to inherited operation
"Set_Property" at pango-enums.ads:170
programenvironment.adb:46:33:   ==> in call to inherited operation
"Set_Property" at pango-enums.ads:169
programenvironment.adb:46:33:   ==> in call to inherited operation
"Set_Property" at pango-enums.ads:168
programenvironment.adb:46:33:   ==> in call to inherited operation
"Set_Property" at pango-enums.ads:167
programenvironment.adb:46:33:   ==> in call to inherited operation
"Set_Property" at pango-enums.ads:166

Similar type-error happens even when I try coloring text, using the code
found in the gtkada-example library
 Color := Gdk.Color.Parse ("red");
        Gtk_New (Tag, "red");
        Add (Table, Tag);
        Set_Property (Tag, Foreground_Gdk_Property, Color);
(see:
http://svn.eu.adacore.com/anonsvn/Dev/trunk/GtkAda/testgtk/create_text_view.adb
)

Instead, the Set_Property is working right if I use Bold/Underline/Italic
font property.

Any idea how to solve it?

Thanks,


-- 
Alessandro Iavicoli
http://www.alessandroiavicoli.it/
http://www.trentoattiva.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/gtkada/attachments/20130420/4d29623d/attachment.html>


More information about the gtkada mailing list