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
9
votes
1 answer

Load GUI from a Glade with GtkSourceView in PyGObject

I'm trying to use a Glade file that has a GtkSourceView widget in PyGObject. I've wrote a little guide on how to start using the new GtkSourceView 3.0 in Glade: http://cjenkins.wordpress.com/2012/05/08/use-gtksourceview-widget-in-glade/ The problem…
Havok
  • 5,776
  • 1
  • 35
  • 44
5
votes
0 answers

How to syntax highlight different assembly languages in Gedit?

By default, text editors using GtkSourceView (such as Gedit and Mousepad) don't highlight .asm files. The solution by Drew Noakes is to download a GtkSourceView language definition file for x86 assembly language into…
Damian Yerrick
  • 4,602
  • 2
  • 26
  • 64
4
votes
1 answer

Syntax highlighting with GTK3 SourceView

How do you enable syntax highlighting in GtkSourceView using GTK3? My code below is not working. # HTML view self.scrolledwindow_html = builder.get_object('scrolledwindow_html') self.sourceview_html = GtkSource.View() self.buffer_html =…
Jishnu
  • 175
  • 1
  • 7
4
votes
2 answers

code folding in gtksourceview

I see on https://live.gnome.org/GtkSourceView that "we can now support code folding in GtkSourceView" using gtk+ 2.8. Yet I can't find any examples anywhere. Is it ready to be used? Are there any examples that can be provided to get the ball…
nomadicME
  • 1,389
  • 5
  • 15
  • 35
3
votes
1 answer

syntax highlighting gtksourceview, use another xml file?

We can add our language definition in gedit in a XML fileformat, in the /usr/share/gtksourceview-3.0/language-specs/ folder, But can we in our XML refere to an other XML file? In my language definition i want to add some script (C , Python ,…
Nazime Lakehal
  • 1,542
  • 1
  • 11
  • 15
3
votes
1 answer

Python3 module equivalent for GtkSourceView2

I'm attempting a port of the abandoned Gedit plugin codecompletion to Python 3. In the original code a Python 2 package is called: import gtksourceview2 as gsv and it is then inherited by a class to, presumably, perform completion: class…
venzen
  • 1,119
  • 10
  • 13
3
votes
1 answer

Matching entire string in gtksourceview

Take this short XML snippet for defining strings in gtksourceview: " "
Charles
  • 11,269
  • 13
  • 67
  • 105
3
votes
2 answers

What has to be Glib::init()'ed in order to use Glib::wrap?

So I'm trying to make use of a GtkSourceView in C++ using GtkSourceViewmm, whose documentation and level of support give me the impression that it hasn't been very carefully looked at in a long time. But I'm always an optimist :) I'm trying to add a…
Adrian Petrescu
  • 16,629
  • 6
  • 56
  • 82
3
votes
4 answers

Determining the mime type of a file

How can I determine the mime-type of a file (in OCaml)? I am trying to set the language for a GtkSourceView control, but to do that, I need to first determine the language. The only way I can see of doing this is using the mime-type - there is a…
a_m0d
  • 12,034
  • 15
  • 57
  • 79
3
votes
2 answers

error while compiling: gtksourceview/gtksource.h: No such file or directory

I am trying to make autocompletion using Gtk.SourceView. I added --pkg gtksourceview-3.0 in the makefile. Now when I try to make, it gives fatal error: gtksourceview/gtksource.h: No such file or directory
3
votes
1 answer

gtksourceview2: implement completion provider

The documentation states about SourceCompletionProvider: You must implement this interface to provide proposals to SourceCompletion What does "implement this interface" means in the context? Should I create new GObject using this functions? Any…
Yuras
  • 13,856
  • 1
  • 45
  • 58
3
votes
1 answer

how to (programmatically) scroll to a specific line in gtktextview/gtksourceview

I am creating a text editor as a way of getting more familiar with C and gtk+. I am using gtk+-2.0 & gtksourceview-2.0, and gtk_scrolled_window . As a first attempt at creating a goto function browser I thought I would just simply create an array…
nomadicME
  • 1,389
  • 5
  • 15
  • 35
2
votes
0 answers

Loading big files into GtkSourceView is slow

I am trying to load 1k+ lines long files into GtkSourceView, using GTK3 in Python (PyGObject). Whenever I set the text, it takes 2-3sec to fully appear (it is slowly scrolling and adding new lines at the bottom). I have connected a profiler and it…
bambucha
  • 56
  • 5
2
votes
1 answer

How to apply style using GtkSourceView library

I'm trying to style a GtkSourceView object in particular I'd like to change the color of line numbers. I'm reading Style Scheme Definition Reference: GtkSourceView 4 Reference Manual. I'm able to change text but not line-numbers. The document…
2
votes
0 answers

How to modify the formatting options for a single in a syntax highliting definition for GEdit?

I made the following language definition for GEdit, an XML dialect aimed to keep the log of measurements. I made it as a modification of the DocBook language definition. File: lcs.lang
1
2 3 4 5 6