On 11/12/2013 10:09 AM, Steve Teale wrote:

OK, checking for the null ListSG, my getTags method appears to work. But then, having got a tag or more, I want to know what font and color are in effect at that point in the TextBuffer. The example is getting bigger, as now I have to select and apply a color to some selected text.

Relevant (I think) section is marked with //************************:

... code ...

Run it and enter a couple of words in the TextView. Select the first word, then press the Color button, that will let you set a color for the word, and will then run the offending code.

This is something that can use some improvement within GtkD, The linked
list contains pointers to the C struct a GtkTextTag* and not a D class.

To fix the example code change line 62 from:

          tta[i] = *(cast(TextTag*) sll.data);

to:

          tta[i] = new TextTag(cast(GtkTextTag*) sll.data);

As for the bast way to improve GtkD in this respect, i will probably add
something like "getTagArray" to TextIter, and ditto for similar
functions. What do you think?