Re: [Vala] Access GTKText



please find as attachment, a sample with a custom Gtk TextBuffer and a
custom TextTag.

link to the TextTag vala doc: http://valadoc.org/#!api=gtk+-3.0/Gtk.TextTag
here a few documentation of text tags parameters :
http://www.bravegnu.org/gtktext/x113.html

regards.


2014/1/14 Gilzad Hamuni <gilli4 gmx net>

Hi list,

I've compiled and tested this C-tutorial that shows how to have different
fonts, colors and and sizes in a single text box:
http://www.gtk.org/tutorial1.2/gtk_tut-14.html

GtkWidget *text;
...
text = gtk_text_new (NULL, NULL);
...
fixed_font = gdk_font_load ("-misc-fixed-medium-r-*-*-*-140-*-*-*-*-*-*");
...
gtk_text_insert (GTK_TEXT (text), fixed_font, &text->style->black,
NULL,"Hello\n", -1);


Now I'd like to do the same in Vala. I've looked through valadoc and what
valencia's completion would provide. But I couldn't find the keywords I
expected in the Gtk namespace. Basically, I need an object that provides
the gtk_text_insert(...) function, which allows me to add formatted text
immediately.

VteTerminal, SourceView and TextView seem to be too limited, as they
doesn't seem to provide such a function. Or am I just to blind to find a
substitude that is as rich?

My understanding of creating GIR and VAPIs is not sufficient, but I think
I wouldn't have to do this for gtktext.h, because the whole gtk-library is
available to vala already?

I'll be happy about any input. Thanks a bunch in advance.

gilzad
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list

Attachment: main.vala
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]