Re: GtkSourceView: code folding



Hi flix,

On Mon, 2014-08-11 at 13:37 +0200, flix wrote:
I'm trying to implement a basic form of text folding (I'm using 
GtkSourceViewmm).
<snip>
     -> I add a ChildAnchor at the beginning with a label widget with 
text: "{...}"

A probably better solution is to implement the code folding as every
other text editor do: show +/- buttons in the margin. See
GtkSourceGutter. I've implemented a prototype of a gutter renderer for
code folding:
https://git.gnome.org/browse/gtksourceview/log/?h=wip/gutter-renderer-folds

Ideally an API for the code folding should be created in GtkSourceView,
but having first a working implementation in an application would be a
good first step.

See also this utility class, which is useful to store the folding points
(it is a private class):
https://git.gnome.org/browse/gtksourceview/tree/gtksourceview/gtksourcemarkssequence.h

Regards,
Sébastien



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