I am creating a text editor in C using gtk+-2.0 gtksourceview-2.0. I am having trouble finding any information about how to comment a line or a block. I am finding plenty of information about how to highlight these commented lines, but nothing about actually creating these comments. I have searched google, devhelp, and the gedit and anjuta sources I use when I get stuck. No joy.
Do I need to write this functionality from scratch or are there any preexisting functions in gtksourceview that enable this functionality? I don't mind writing it from scratch, it just seems like such basic functionality, and I didn't want to waste my time reinventing the wheel. Thanks.
That function doesn't exist. See this code for an example if you don't want to reinvent the wheel; look at the functions action_comment_out_selection()
and action_uncomment_selection()
.