зеркало из https://github.com/mono/mail-archives.git
102 строки
4.8 KiB
HTML
102 строки
4.8 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [Gtk-sharp-list] GtkSourceView language and style definitions
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20GtkSourceView%20language%20and%20style%20definitions&In-Reply-To=49DEF4F7.1010207%40gmail.com">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
<LINK REL="Previous" HREF="009558.html">
|
|
<LINK REL="Next" HREF="009560.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[Gtk-sharp-list] GtkSourceView language and style definitions</H1>
|
|
<B>Michael Hutchinson</B>
|
|
<A HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20GtkSourceView%20language%20and%20style%20definitions&In-Reply-To=49DEF4F7.1010207%40gmail.com"
|
|
TITLE="[Gtk-sharp-list] GtkSourceView language and style definitions">m.j.hutchinson at gmail.com
|
|
</A><BR>
|
|
<I>Fri Apr 10 12:36:17 EDT 2009</I>
|
|
<P><UL>
|
|
<LI>Previous message: <A HREF="009558.html">[Gtk-sharp-list] GtkSourceView language and style definitions
|
|
</A></li>
|
|
<LI>Next message: <A HREF="009560.html">[Gtk-sharp-list] can't configure gtk#2.8.5
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#9559">[ date ]</a>
|
|
<a href="thread.html#9559">[ thread ]</a>
|
|
<a href="subject.html#9559">[ subject ]</a>
|
|
<a href="author.html#9559">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE>2009/4/10 Alexander Krivács Schrøder <<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">alexschrod at gmail.com</A>>:
|
|
><i> Hi everybody.
|
|
</I>><i>
|
|
</I>><i> I'm moving a project of mine from C & Gtk to C# & Gtk#. Most of the
|
|
</I>><i> transition has gone smoothly, but I find myself facing one small issue.
|
|
</I>><i> I'm using the GtkSourceView Widget, and in my original C code, here's
|
|
</I>><i> what I did to load my self-defined language and style scheme:
|
|
</I>><i>
|
|
</I>><i>        GtkSourceLanguageManager *lm;
|
|
</I>><i>        GtkSourceStyleSchemeManager *ssm;
|
|
</I>><i>        gchar *dirs[3];
|
|
</I>><i>
|
|
</I>><i>        dirs[0] = g_strdup("lang");
|
|
</I>><i>        dirs[1] = g_strdup(DEFAULT_DATA_DIR "/" PACKAGE "/lang");
|
|
</I>><i>        dirs[2] = NULL; /* Sentinel */
|
|
</I>><i>
|
|
</I>><i>        /* Load the language file */
|
|
</I>><i>        lm = gtk_source_language_manager_new();
|
|
</I>><i>        gtk_source_language_manager_set_search_path(lm, dirs);
|
|
</I>><i>        lang =  gtk_source_language_manager_get_language(lm, "mylang");
|
|
</I>><i>
|
|
</I>><i>        /* Load the scheme file */
|
|
</I>><i>        ssm = gtk_source_style_scheme_manager_new();
|
|
</I>><i>        gtk_source_style_scheme_manager_set_search_path(ssm, dirs);
|
|
</I>><i>        style =gtk_source_style_scheme_manager_get_scheme(ssm,"mylang");
|
|
</I>><i>
|
|
</I>><i> However, looking at the SourceLanguagesManager class, I couldn't find
|
|
</I>><i> any SearchPath property or SetSearchPath method, and I couldn't even
|
|
</I>><i> find a SourceStyleManager class at all! Can somebody help me figure this
|
|
</I>><i> out?
|
|
</I>><i>
|
|
</I>><i> Essentially what I'm asking is how I load my style scheme and language
|
|
</I>><i> definition file.
|
|
</I>
|
|
The search paths were only added in GtkSourceView2. Because
|
|
GtkSourceView2 broke binary compatibility with GtkSourceview1.8, there
|
|
are two bindings -- GtkSourceView-Sharp-2.0 (the 2.0 version of the
|
|
binding to the 1.8 library) and GtkSourceView2-Sharp. It sounds like
|
|
you want the latter.
|
|
|
|
--
|
|
Michael Hutchinson
|
|
<A HREF="http://mjhutchinson.com">http://mjhutchinson.com</A>
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI>Previous message: <A HREF="009558.html">[Gtk-sharp-list] GtkSourceView language and style definitions
|
|
</A></li>
|
|
<LI>Next message: <A HREF="009560.html">[Gtk-sharp-list] can't configure gtk#2.8.5
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#9559">[ date ]</a>
|
|
<a href="thread.html#9559">[ thread ]</a>
|
|
<a href="subject.html#9559">[ subject ]</a>
|
|
<a href="author.html#9559">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
|
|
<hr>
|
|
<a href="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">More information about the Gtk-sharp-list
|
|
mailing list</a><br>
|
|
</body></html>
|