[Gtk-sharp-list] RE: Inserting attributes into a Pango.Layout

Willem J.W. Semmelink willems@digicore.co.za
Tue, 24 Feb 2004 16:53:24 +0200

Hi Tiago
I did the following:

Pango.Layout layout =3D dc.CreatePangoLayout("Hello There");
if (layout.Attributes =3D=3D null)=20
   System.Console.WriteLine("Attributes is NULL");

Nothing was output to the console. I then confirmed by running in the=20
Visual Studio debugger - it never executed the WriteLine statement.=20
So I guess Attributes is never null by me - perhaps a difference between =
0.15 and 0.16?

I get the error messages to the console only when I add the lines:
Pango.Attribute attribute =3D Pango.Attr.ForegroundNew(0xff, 0, 0); // =
attribute.start_index =3D 0;
attribute.end_index =3D 1;

The error messages also indicate a list being NULL, but in my case I =
doubt that it is the=20
Attributes list.  The next step would be to inspect the C code at the =
reported line.
I only work with the Gtk# binaries, so I haven't ventured that far yet.


-----Original Message-----
From: Tiago Lima [mailto:tiago.lima@vianw.pt]
Sent: 24 February 2004 03:28 PM
To: gtk-sharp-list@lists.ximian.com
Cc: Willem J.W. Semmelink
Subject: Re: [Gtk-sharp-list] RE: Inserting attributes into a

I think the problem appears to be that when:

	Pango.Layout layout =3D dc.CreatePangoLayout("Hello There");

the "layout.Attributes" in my case is NULL !!! which I had to make:

	layout.Attribute =3D new AttrList();

but in this case one wonders what needs to be initialized appart from =
"new" statement... Should it be NULL ? Is it NULL in your case ? Try =
an "if (layout.Attributes =3D=3D null) <something>" right after the=20
CreatePangoLayout to see if its null or so...

Oh, I'm using Gtk# 0.16... didnt try with 0.15 though...

	Tiago Lima