[Gtk-sharp-list] GtkSourceView language and style definitions

Alexander Krivács Schrøder alexschrod at gmail.com
Fri Apr 10 03:27:51 EDT 2009

Hi everybody.

I'm moving a project of mine from C & Gtk to C# & Gtk#. Most of the
transition has gone smoothly, but I find myself facing one small issue.
I'm using the GtkSourceView Widget, and in my original C code, here's
what I did to load my self-defined language and style scheme:

	GtkSourceLanguageManager *lm;
	GtkSourceStyleSchemeManager *ssm;
	gchar *dirs[3];
	dirs[0] = g_strdup("lang");
	dirs[1] = g_strdup(DEFAULT_DATA_DIR "/" PACKAGE "/lang");
	dirs[2] = NULL; /* Sentinel */
	/* Load the language file */
	lm = gtk_source_language_manager_new();
	gtk_source_language_manager_set_search_path(lm, dirs);
	lang =  gtk_source_language_manager_get_language(lm, "mylang");
	/* Load the scheme file */
	ssm = gtk_source_style_scheme_manager_new();
	gtk_source_style_scheme_manager_set_search_path(ssm, dirs);
	style =gtk_source_style_scheme_manager_get_scheme(ssm,"mylang");

However, looking at the SourceLanguagesManager class, I couldn't find
any SearchPath property or SetSearchPath method, and I couldn't even
find a SourceStyleManager class at all! Can somebody help me figure this

Essentially what I'm asking is how I load my style scheme and language
definition file.

Thanks for your help,
Alexander Krivács Schrøder

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20090410/26854331/attachment.bin 

More information about the Gtk-sharp-list mailing list