TextView or SourceView line numbers (original) (raw)
Hello all,
I am trying a very simple text view attempt and I would like to see the line numbers of the widget. I read that I should be using gtksourceview instead of textview but I found it very complicated and I could not find any examples or tutorial to try. Can you give me an example for the easiest and simplest way of using sourceview to only show line numbers ?
Thank in advance
mazharhussain (Mazhar Hussain) June 18, 2023, 12:47pm 2
GtkSource.View
is a subclass of Gtk.TextView
. Therefore, you can use it the same way you would use a Gtk.TextView
. Just set the show-line-numbers
property to TRUE
.
GtkWidget *source_view = gtk_source_view_new ();
gtk_source_view_set_show_line_numbers (GTK_SOURCE_VIEW (source_view), TRUE);
system (system) Closed July 18, 2023, 12:48pm 3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.