[Gtk-sharp-list] Gtk.RecentManager: Way to list Items

Nils Andresen andresen.nils at googlemail.com
Mon Oct 12 02:24:35 EDT 2009


Hi,
I am currently a little "stuck".

I wanted to list all my "Recently Used" Items. I use this code:

>public static void Main(string[] args)
>{
>   Application.Init ();
>   RecentManager rm = RecentManager.Default;
>    GLib.List items = rm.Items;
>    Console.WriteLine(items.Count+" items.");
>    foreach(object item in items)
>    {
>        Console.WriteLine(item.ToString());
>    }
>    Console.WriteLine("Done.");
>    Console.ReadKey();
>}

If the Items-list is empty all works as expected. However if the
RecentManager does in fact contain Items, I'm getting:

>3 items.
>Stacktrace:
>
>  at (wrapper managed-to-native) GLib.Object.gtksharp_is_object (intptr) <0x00070>
>  at (wrapper managed-to-native) GLib.Object.gtksharp_is_object (intptr) <0xffffffff>
>  at GLib.Object.IsObject (intptr) <0x00013>
>  at GLib.ListBase.DataMarshal (intptr) <0x003ff>
>  at GLib.ListBase/ListEnumerator.get_Current () <0x0004b>
>  at ruCmd.MainClass.Main (string[]) [0x00038] in /home/nils/Projekte/RecentlyUsed/ruCmd/Main.cs:14
>  at (wrapper runtime-invoke) ruCmd.MainClass.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>
>
>Native stacktrace:
>
>    /usr/bin/mono [0x480c90]
>    /usr/bin/mono [0x4b004d]
>    /lib/libpthread.so.0 [0x7fad5b7c85a0]
>    /usr/lib/libgobject-2.0.so.0(g_type_check_instance_is_a+0x53) [0x7fad55c642e3]
>    [0x41d48b00]
>
>=================================================================
>Got a SIGSEGV while executing native code. This usually indicates
>a fatal error in the mono runtime or one of the native libraries
>used by your application.
>=================================================================

Is there an error in my handling of Gtk#/GLib ? I have already rebuild
my mono-environment.

Yours,
Nils


More information about the Gtk-sharp-list mailing list