mail-archives/gtk-sharp-list/2009-October/009893.html

109 строки
4.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] Gtk.RecentManager: Way to list Items
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Gtk.RecentManager%3A%20Way%20to%20list%20Items&In-Reply-To=">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="009892.html">
<LINK REL="Next" HREF="009894.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] Gtk.RecentManager: Way to list Items</H1>
<B>Nils Andresen</B>
<A HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Gtk.RecentManager%3A%20Way%20to%20list%20Items&In-Reply-To="
TITLE="[Gtk-sharp-list] Gtk.RecentManager: Way to list Items">andresen.nils at googlemail.com
</A><BR>
<I>Mon Oct 12 02:24:35 EDT 2009</I>
<P><UL>
<LI>Previous message: <A HREF="009892.html">[Gtk-sharp-list] GIO# System.InvalidCastException in VolumeMonitor.MountAdded event
</A></li>
<LI>Next message: <A HREF="009894.html">[Gtk-sharp-list] Gtk.RecentManager: Way to list Items
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#9893">[ date ]</a>
<a href="thread.html#9893">[ thread ]</a>
<a href="subject.html#9893">[ subject ]</a>
<a href="author.html#9893">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Hi,
I am currently a little &quot;stuck&quot;.
I wanted to list all my &quot;Recently Used&quot; Items. I use this code:
&gt;<i>public static void Main(string[] args)
</I>&gt;<i>{
</I>&gt;<i> &#160; Application.Init ();
</I>&gt;<i> RecentManager rm = RecentManager.Default;
</I>&gt;<i>&#160; &#160; GLib.List items = rm.Items;
</I>&gt;<i>&#160; &#160; Console.WriteLine(items.Count+&quot; items.&quot;);
</I>&gt;<i>&#160; &#160; foreach(object item in items)
</I>&gt;<i>&#160; &#160; {
</I>&gt;<i>&#160; &#160; &#160; &#160; Console.WriteLine(item.ToString());
</I>&gt;<i>&#160; &#160; }
</I>&gt;<i>&#160; &#160; Console.WriteLine(&quot;Done.&quot;);
</I>&gt;<i>&#160; &#160; Console.ReadKey();
</I>&gt;<i>}
</I>
If the Items-list is empty all works as expected. However if the
RecentManager does in fact contain Items, I'm getting:
&gt;<i>3 items.
</I>&gt;<i>Stacktrace:
</I>&gt;<i>
</I>&gt;<i>&#160; at (wrapper managed-to-native) GLib.Object.gtksharp_is_object (intptr) &lt;0x00070&gt;
</I>&gt;<i>&#160; at (wrapper managed-to-native) GLib.Object.gtksharp_is_object (intptr) &lt;0xffffffff&gt;
</I>&gt;<i>&#160; at GLib.Object.IsObject (intptr) &lt;0x00013&gt;
</I>&gt;<i>&#160; at GLib.ListBase.DataMarshal (intptr) &lt;0x003ff&gt;
</I>&gt;<i>&#160; at GLib.ListBase/ListEnumerator.get_Current () &lt;0x0004b&gt;
</I>&gt;<i>&#160; at ruCmd.MainClass.Main (string[]) [0x00038] in /home/nils/Projekte/RecentlyUsed/ruCmd/Main.cs:14
</I>&gt;<i>&#160; at (wrapper runtime-invoke) ruCmd.MainClass.runtime_invoke_void_object (object,intptr,intptr,intptr) &lt;0xffffffff&gt;
</I>&gt;<i>
</I>&gt;<i>Native stacktrace:
</I>&gt;<i>
</I>&gt;<i>&#160; &#160; /usr/bin/mono [0x480c90]
</I>&gt;<i>&#160; &#160; /usr/bin/mono [0x4b004d]
</I>&gt;<i>&#160; &#160; /lib/libpthread.so.0 [0x7fad5b7c85a0]
</I>&gt;<i>&#160; &#160; /usr/lib/libgobject-2.0.so.0(g_type_check_instance_is_a+0x53) [0x7fad55c642e3]
</I>&gt;<i>&#160; &#160; [0x41d48b00]
</I>&gt;<i>
</I>&gt;<i>=================================================================
</I>&gt;<i>Got a SIGSEGV while executing native code. This usually indicates
</I>&gt;<i>a fatal error in the mono runtime or one of the native libraries
</I>&gt;<i>used by your application.
</I>&gt;<i>=================================================================
</I>
Is there an error in my handling of Gtk#/GLib ? I have already rebuild
my mono-environment.
Yours,
Nils
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="009892.html">[Gtk-sharp-list] GIO# System.InvalidCastException in VolumeMonitor.MountAdded event
</A></li>
<LI>Next message: <A HREF="009894.html">[Gtk-sharp-list] Gtk.RecentManager: Way to list Items
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#9893">[ date ]</a>
<a href="thread.html#9893">[ thread ]</a>
<a href="subject.html#9893">[ subject ]</a>
<a href="author.html#9893">[ 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>