Questions tagged [gtksourceview]

GtkSourceView is a portable C library that extends the standard GTK+ framework.

GtkSourceView is a portable C library that extends the standard GTK+ framework for multiline text editing with support for configurable syntax highlighting, unlimited undo/redo, UTF-8 compliant caseless searching, printing and other features typical of a source code editor.

GtkSourceView is licensed under the GNU LGPL 2.1 and is part of the GNOME Desktop Environment.

87 questions
2
votes
0 answers

Why can I not use GtkSourceView in GtkBuilder, loading a file by Glade?

I made a *.ui file in glade, and it won't load with GtkBuilder. "Invalid object type 'GtkSourceView'" GEdit uses GtkSourceMap, and I was not able to do that either. I've scoured the internet, and none of the answers worked, i.e., installing…
2
votes
1 answer

C Gtk+2 Glade3: how can i set a SourceBuffer to a GtkSourceView that was loaded from glade?

I'm trying to load a .c file into a GtkSourceView widget. Using C Language, with Gtk+ 2.22.1 and Glade 3.6.7 and GtkSourceView 2.10.1. I noticed that in Glade UI I can only configure a SourceView to hold a TextBuffer; I did not find a SourceBuffer…
ufk
  • 30,912
  • 70
  • 235
  • 386
2
votes
1 answer

GtkSourceView/ GtkSourceBuffer - How to mark a line in red and show an icon

I would like to mark some text in a GtkSourceView in red and show an icon. Here my current attempt which seems to do nothing at all: void plainTextEditor_textView_addLineMarker(int lineNumber, linemarker* marker, context_base* context) { …
Alex
  • 1,602
  • 20
  • 33
2
votes
2 answers

How to make basic code autocompletion?

I'm making simple code editor in GTK and gtksourceview2.0. I would like to add to my editor a code completion window. There should be 10-15 keywords (always the same). Can anyone could give me url for some tutorials or describe usage of…
BPS
  • 135
  • 1
  • 10
2
votes
2 answers

Add a new language to gtksourceview (Django's template language for gedit)

I got a problem to add a new language to gtksourceview (used by gedit). I want to add the Django's template language and something does not work : I am not able to make %} stop the syntactic coloring. Here is a snippet :
antoyo
  • 11,097
  • 7
  • 51
  • 82
2
votes
1 answer

how to use GtkSource.FileLoader in python3

As the documentation suggests here, have a GtkSource.View object, i've retrieved its buffer and passed in as parameter in GtkSource.FileLoader.new . Basically here is my code: # set file loader file = GtkSource.File() …
Ishan Khare
  • 1,745
  • 4
  • 28
  • 59
2
votes
1 answer

Efficiently matching correctly spelled parts of arguments with regex

I'm trying to write a GtkSourceView language file to highlight some of my files in gedit. The problem I'm encountering is that I want to highlight words that contain at least the first four characters and are correctly spelled. To illustrate, say I…
Martin S.
  • 35
  • 5
2
votes
1 answer

gtksourceview language file regex - look behind

I'm trying to extend the C language definition found in gtksourceview-3.0, the full original file can be found here. I just want to make a few syntax rules uses regex's, so I can syntax highlight stuff like functions, class members in gedit.…
badger5000
  • 650
  • 7
  • 17
2
votes
1 answer

GJs/Seed GtkSourceView

I can get a Gtk.TextView working with the following code— const Gtk = imports.gi.Gtk; let mtext1 = new Gtk.TextView(); However, I would rather use a GtkSourceView, as it has line numbers. How can I do this? I can't find much documentation around…
Jacob
  • 1,335
  • 1
  • 14
  • 28
2
votes
0 answers

insert comment / undo failing in gtksourceview

I've just stumbled upon a subtle problem with my insert comment and undo functions. Steps to reproduce: open editor insert comment somewhere in the sourcebuffer hit ctrl+z to undo insert another comment, the comment is inserted ok, but the…
nomadicME
  • 1,389
  • 5
  • 15
  • 35
2
votes
2 answers

Valac "undefined reference" error with gtksourceview

I am currently working on a project in vala and I am having trouble getting the project to compile. The files pass through valac, just fine but then I get this error: C:\Users\Andrew\AppData\Local\Temp/ccEYx9mD.o:EditorWindow.vala.c:(.text+0x437):…
Andrew Benton
  • 506
  • 2
  • 12
2
votes
1 answer

what happened to gtk_source_iter_forward_search in gtksourceview-3.0

I've looked at the GtkSourceView 3 Reference Manual, and I've googled for a while, but I cannot find any mention of why gtk_source_iter_forward_search was dropped from gtksourceview or what should be used instead. I've also looked at the features…
nomadicME
  • 1,389
  • 5
  • 15
  • 35
2
votes
1 answer

GtkSourceView Scroll to Line with Gobject Introspection [python]

I have successfully created a python GTK application using Gobject Introspection, and opened a source file in a GTKSourceView Widget. I am attempting to scroll to place a specific line (line 150) into the center of the screen when the user clicks a…
tel0s
  • 75
  • 1
  • 6
2
votes
2 answers

gtk+ text editor vim type modes (insert / command)

I'm trying to incorporate vim like functionality in a text editor I am creating in gtk+ 2.0 and gtksourceview 2.0. I have it working except when I press "i" to enter insert mode it enters this mode properly, but then it types an "i" in the text…
nomadicME
  • 1,389
  • 5
  • 15
  • 35
2
votes
1 answer

how to programmatically select text (primary selection) in a gtk text buffer

I am writing a text editor using gtk+-2.0 & gtksourceview-2.0. I am having trouble finding a way to programmatically select a block of text and add it to the OS (linux) primary selection clipboard. Just like if I hightlighted a block of text with…
nomadicME
  • 1,389
  • 5
  • 15
  • 35