comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Bug in GtkAda
Date: Fri, 16 Oct 2009 20:32:29 +0200
Date: 2009-10-16T20:32:30+02:00	[thread overview]
Message-ID: <1u1s3pcszobw5.1cmzjrx1xcb8c$.dlg@40tude.net> (raw)
In-Reply-To: 27a2a466-27bb-4765-8b15-8c40c3973015@b2g2000yqi.googlegroups.com

On Fri, 16 Oct 2009 03:20:39 -0700 (PDT), RasikaSrinivasan@gmail.com wrote:

> My assumption is -Lc:\gnat\2009\gtkada\lib in the command line pulls
> the gtkada library (I suspect there is a pragma in the GtkAda source
> somewhere to specify library). (I am including the gtkada.gpr).

Yes, you seem to be right. I have looked at the sources, and it is almost
certainly a bug. libgtkada.a does not contain
_ada_text_attribute_get_appearance (nm does not list it).

The problem is that Get_Appearance is a macro, not a library Gtk operation.
This is the reason why AdaCore put it into the library, though it could
rather place it in the sources.

You could implement it yourself looking at the structure GtkTextAttributes.
See here:

http://library.gnome.org/devel/gtk/stable/GtkTextTag.html#GtkTextAttributes

It seems that you could just convert Gtk_Text_Attribute to
Gtk_Text_Appearance since both are bare pointers to a prefix of another.
E.g.

   function Get_Appearance (Text_Attr : Gtk_Text_Attributes)
      return Gtk_Text_Appearance is
   begin
      return Gtk_Text_Appearance ((Text_Attr);
   end Get_Appearance;

(I didn't try it)

> Anycase, I should look at the syntax coloring example. I think I have
> seen your Ada bindings. I will definitely take a look.

GtkSourceView comes with a library of language syntax descriptions.
Probably your language is already there, e.g. it has Ada. BTW, this one
used by GNOME;s gedit, which is based on GtkSourceView. If you need to
create yours, there is a how-to:

http://library.gnome.org/devel/gtksourceview/stable/lang-tutorial.html

I wrote one for the FCL, it wasn't that difficult, despite XML/RegEx suff.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



      reply	other threads:[~2009-10-16 18:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-16  1:22 Bug in GtkAda RasikaSrinivasan@gmail.com
2009-10-16  7:33 ` Dmitry A. Kazakov
2009-10-16 10:20   ` RasikaSrinivasan@gmail.com
2009-10-16 18:32     ` Dmitry A. Kazakov [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox