Author: jluke
Date: 2005-04-21 22:03:47 -0400 (Thu, 21 Apr 2005)
New Revision: 43423

Modified:
   trunk/gtk-sharp/sample/GtkDemo/DemoIconView.cs
Log:
make the icon view actually work


Modified: trunk/gtk-sharp/sample/GtkDemo/DemoIconView.cs
===================================================================
--- trunk/gtk-sharp/sample/GtkDemo/DemoIconView.cs      2005-04-22 00:46:57 UTC 
(rev 43422)
+++ trunk/gtk-sharp/sample/GtkDemo/DemoIconView.cs      2005-04-22 02:03:47 UTC 
(rev 43423)
@@ -37,9 +37,8 @@
                        homeButton.IsImportant = true;
                        toolbar.Insert (homeButton, -1);
 
-                       // FIXME: use the real icons later 
-                       fileIcon = Gdk.Pixbuf.LoadFromResource ("MonoIcon.png");
-                       dirIcon = Gdk.Pixbuf.LoadFromResource ("MonoIcon.png");
+                       fileIcon = GetIcon ("gnome-fs-regular");
+                       dirIcon = GetIcon ("gnome-fs-directory");
 
                        ScrolledWindow sw = new ScrolledWindow ();
                        sw.ShadowType = ShadowType.EtchedIn;
@@ -66,10 +65,15 @@
                        ShowAll ();
                }
 
+               Gdk.Pixbuf GetIcon (string name)
+               {
+                       return Gtk.IconTheme.Default.LoadIcon (name, 32, 
(IconLookupFlags) 0);
+               }
+
                ListStore CreateStore ()
                {
                        // path, name, pixbuf, is_dir
-                       ListStore store = new ListStore (typeof (string), 
typeof (string), typeof (Gdk.Pixbuf), typeof (bool));
+                       ListStore store = new ListStore (GLib.GType.String, 
GLib.GType.String, Gdk.Pixbuf.GType, GLib.GType.Boolean);
 
                        // Set sort column and function
                        store.SetDefaultSortFunc (SortFunc);
@@ -90,7 +94,7 @@
                        foreach (DirectoryInfo di in parent.GetDirectories ())
                        {
                                if (!di.Name.StartsWith ("."))
-                                       store.AppendValues (di.FullName, 
di.Name, dirIcon, false);
+                                       store.AppendValues (di.FullName, 
di.Name, dirIcon, true);
                        }
                        
                        foreach (FileInfo file in parent.GetFiles ())

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to