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:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=7EBX7SSC5H8QrH85lorBvTNw3wKvbgTsjKVZ90pmz7I=; b=sc3AvlsYuqKMZjxjifjA72/NbH3cqFjZ3+9Nb1wPBnkAwoK2fMpwftHajspWqaPmE5/K8WxRffEQbjK4AKEZQ0Tw5k0FHU3bXAgeUtRwY35FUEJo4AEUlC8dpw29hvJJGTnq3yEByJqFRfLUaXSEeXUI946FAbyDemdj3WrsH04= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=OVhed/OPphjs9rYFp2Wrufjgp7YyGQYocGvDMdQsti97po7ktiOvRMUyvMTrx7ta+YtB5NM6YzHu+AY/DIE5y64LlzZ3Unb0l/qDSouzuaZovUmN9aiMlhA7KipJd+Q/W9hkDPEA8zKQRQ1KTt6GrvC01Hh1FA1hntlwYDzZdxI= Message-ID: <666572260802050132h2f65356av9ee86bd701fcd1df at mail.gmail.com> Date: Tue, 5 Feb 2008 10:32:18 +0100 From: Adrien To: "Julien Moutinho" , lablgtk at yquem.inria.fr Subject: Re: [Lablgtk] List view : no scroll bar and maximum length ? In-Reply-To: <20080204220421.GA28520 at localhost> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <666572260802041301p2bd86a20v9672abf9fa675de8 at mail.gmail.com> <20080204220421.GA28520@localhost> Content-Type: text/plain; charset=ISO-8859-1 Content-Length: 3154 Hi again, Thanks a lot. This has perfectly worked and even with 100 000 entries, gui is fast. However the list view is too short and only displays 3 elements at once but I guess this is because I haven't yet taken time to tweak anything. So I'll see that more precisely during the week. Thanks again. --- Adrien Nader 2008/2/4, Julien Moutinho : > On Mon, Feb 04, 2008 at 10:01:48PM +0100, Adrien wrote: > > Hi, > 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. > > Use a GBin.scrolled_window. > > % diff -u second_try.ml.old second_try.ml > --- second_try.ml.old 2008-02-04 22:47:05.000000000 +0100 > +++ second_try.ml 2008-02-04 22:55:02.000000000 +0100 > @@ -39,7 +39,9 @@ > 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 sw =3D GBin.scrolled_window () ~packing: vbox#add > + ~hpolicy: `AUTOMATIC ~vpolicy: `AUTOMATIC > +let playlist_view=3DGTree.view () ~packing:sw#add > let _=3Dplaylist_view#append_column (GTree.view_column ~title:"Rank" ~re= nderer:(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]) ()) > > > 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 asynchronousl= y; > > 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() fun= ction.) > > It should not crash any longer once the scroll bar has been added. > > HTH. > > _______________________________________________ > Lablgtk mailing list > Lablgtk@yquem.inria.fr > http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk > _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk