To: Robert Roessler Cc: LablGTK List Subject: Re: Pixbuf combo box References: <43A72F18.6000309@rftp.com> From: Dmitry Bely Date: Tue, 20 Dec 2005 13:28:08 +0300 In-Reply-To: <43A72F18.6000309 at rftp.com> (Robert Roessler's message of "Mon, 19 Dec 2005 14:07:20 -0800") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Robert Roessler writes: > Dmitry Bely wrote: >> OK, trying to make it running myself, I've faced the following problem: >> # let columns = new GTree.column_list;; >> val columns : GTree.column_list = >> # let icon_c = columns#add (Gobject.Data.gobject_by_name "GdkPixbuf");; >> Exception: Failure "Gobject.Type.from_name: GdkPixbuf". > > You can not always take arbitrary expressions out of context and > expect them to work... :) > > Here, it seems like you need to actually have created a GdkPixbuf > first. In the context of this example, try inserting the following > before the above code: > > let _ = GdkPixbuf.from_file "gnome-fs-regular.png";; It's a very strange behaviour (not to say a bug). IMHO, at least it should be documented somethere, shouldn't it? >> This is just taken from lablgtk-2.6.0/examples/iconview.ml, why it does not >> work? (the example itself fails on my Win32 system with >> Exception: Sys_error "/: Invalid argument". >> - probably it was written with Unix in mind) > > As for the full example itself, yes, you need to change [at least] the > "/" in line 123 to something Windows likes, e.g., "c:/": > > let data = create_store file_pb folder_pb "c:/" in It still won't work: go to some top-level directory and then return to c:\. You'll see C:\Work\Ocaml\lablgtk-2.6.0\examples>lablgtk2 unix.cma iconview.ml tree_path = 20 path = c:/atest In callback for signal clicked, uncaught exception: Unix.Unix_error(20, "stat", "c:atest") OK, this does not relate to LablGtk in any way, but still its examples should be correct :-) BTW, I think that it is a bug then (Sys.readdir "/") raises an Sys_error exception under Win32. I have submitted the Ocaml bug report on that behaviour. > Beyond that, there are more problems at runtime - some directories get > displayed properly, and on others, the program just stops > responding... perhaps worse than this, the example program is *really* > slow at scanning and displaying directory contents. > > Since overall, GTK on my Windows XP box does not seem terribly slow, I > am hoping that this is just reflecting a weakness in this example. - Dmitry Bely