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

Christian Hoff christian_hoff at gmx.net
Tue Oct 13 01:21:45 EDT 2009


This has already been fixed in trunk, but unfortunately the patch was 
never backported to 2.12. See 
http://bugzilla.novell.com/show_bug.cgi?id=387754

You can reopen the report if you need this to be fixed in 2.12.

Christian

Nils Andresen wrote:
> 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
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>   



More information about the Gtk-sharp-list mailing list