[Gtk-sharp-list] gtksourceview Problems
Martin Willemoes Hansen
mwh@sysrq.dk
Thu, 11 Dec 2003 17:39:30 +0100
On Thu, 2003-12-11 at 12:51, Calum Shaw-Mackay wrote:
> Hi
>
> I'm looking at gtksourceview and gtksourceview-sharp and I need a
little
> help
>
> If I try with a mime/file type that will not be recognised by
sourceview,
> no cast exception is thrown.
>
> Whenever I try to select a recognised language from SourceLanguages
Manager,
>
> I get an InvalidCastException in GetLanguageFromMimeType()
> It also happens if I try to cast to SourceLanguage for elements in
> SourceLanguagesManager.AvailableLanguages
Check out latest cvs version of gtksourceview-sharp
I have latest cvs and mono-0.29, gtk-sharp-0.14, gtksourceview-0.7.0 and
when I run this sample of code:
using System;
using Gtk;
class SourceViewTest {
static void Main()
{
Application.Init();
SourceLanguagesManager slm =
new SourceLanguagesManager();
SourceLanguage sl =
slm.GetLanguageFromMimeType ("text/x-csharp");
Console.WriteLine ("Language: {0}", sl.Name);
}
}
I get this output:
Language: C#
Hope it helps.
--
Martin Willemoes Hansen
--------------------------------------------------------
E-Mail mwh@sysrq.dk Website mwh.sysrq.dk
IRC MWH, freenode.net
--------------------------------------------------------