Delivered-To: lablgtk at yquem.inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=sa2pfCXrhQN0sJkN71BlcnSqa7cYoDnG0HwZY7OtntM=; b=Qi6306fTbngEiDJmiADzkxRsn/7Y6gqgR5iTqJJTRGDy/kfXHYGWflRHumOHTADpUmlBmyfnmEDqWW3UPuyj6iDifQCj9+yoaqPzr5Yiu7ToFqoBXOc2IwFABiv7Bb3NdAA6Ed5nUMvqoZUe41omKYTbGK2eRHcLIKE5yQ9Li38= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=qXsKuG8MGnJ7MiFrYbqIIWnwBHdyvZwGety5fz9ti3L6xhSwu7f2hi3GJIh7Xibb/iNWIYICwZOdmYD9lIozVJkObYuLCGV9VidAEFSwsmaEBK3RMtWOPRzBvlwrtXkioLDVaWoSFBadlD6ONyzYQH/AniJRDyqydoHVFVcY6i8= Message-ID: <666572260802041301p2bd86a20v9672abf9fa675de8 at mail.gmail.com> Date: Mon, 4 Feb 2008 22:01:48 +0100 From: Adrien To: lablgtk at yquem.inria.fr MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: [Lablgtk] List view : no scroll bar and maximum length ? Content-Type: text/plain; charset=ISO-8859-1 Content-Length: 2812 Hi, I've written a small mp3 player during the week-end, mainly in order to check whether it was possible to write a light and fast one with lablgtk (I miss foobar2000's interface under linux). I've encountered some problems, especially with list view (which the biggest difference between a foobar ui and a winamp one : http://foobar2000.org/screenshots/img/main-simple.png.html ) My interface looks like : http://ocaml.yaxm.org/files/blatere/pr11n.png (1000 times the same file in order to see how it scaled) First, I don't have any scroll bar though my playlist is 1000 elements long. I know there is the GRange module but I can't believe these scroll bars are not automatic. Second, if I create a 2000 elements-long playlist, my program crashes with the following message: The program 'blat=E8re' received an X Window System error. This probably reflects a bug in the program. The error was 'BadAlloc (insufficient resources for operation)'. (Details: serial 462 error_code 11 request_code 53 minor_code 0) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() functio= n.) I can't manage to get anything more useful. However I guess this has to do something with the way I add rows : let playlist=3Dnew GTree.column_list let rank_column=3Dplaylist#add Gobject.Data.string let fileinfo_column=3Dplaylist#add Gobject.Data.string let playlist_view=3DGTree.view ~packing:vbox#pack () let _=3Dplaylist_view#append_column (GTree.view_column ~title:"Rank" ~renderer:(GTree.cell_renderer_text [], ["text", rank_column]) ()) let _=3Dplaylist_view#append_column (GTree.view_column ~title:"File Info" ~renderer:(GTree.cell_renderer_text [], ["text", fileinfo_column]) ()) let playlist_store=3DGTree.list_store playlist let rec fill_playlist n pl=3D match pl with |[]->() |t::q->let this_playlist_entry=3Dplaylist_store#append () in let _=3Dplaylist_store#set ~row:this_playlist_entry ~column:rank_column ("["^(string_of_int n)^"]") in let _=3Dplaylist_store#set ~row:this_playlist_entry ~column:fileinfo_column t in fill_playlist (n+1) q let _=3Dfill_playlist 1 pl let _=3Dplaylist_view#set_model (Some playlist_store#coerce) The source can be found at http://ocaml.yaxm.org/files/blatere/second_try.m= l (remember this is the first time I get serious at using lablgtk) Thanks. --- Adrien Nader _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk