News Archive
PhpRiot Newsletter
Your Email Address:

More information

Apply style to Textview: Underline and Blue Color on specific parts of the text.

Note: This article was originally published at Planet PHP on 5 January 2012.
Planet PHP

This script displays a 2D array inside a textview. All elements on the same row and coloumn are underlined and colred blue.

//Definition of widgets
$scrolled_win = new GtkScrolledWindow();
$textview = new GtkTextview();
$buffer = new GtkTextBuffer();
$win = new GtkWindow();

//Modify widgets
$textview-modify_font(new PangoFontDescription('Courier New 14'));
$win-connect_simple('destroy', array('Gtk', 'main_quit'));

//Pack widgets

read more