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:received:date:to:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:content-transfer-encoding:in-reply-to:user-agent:from; bh=NMGOFvJ9REGCIGlrhUQ1chkKJ8LRATyoKEN025Z0+Q8=; b=nY9hNPKna/8WG90hET3psRnLaoBSVYDLbchYfHijOi0gqMtO3s7Ze0+A9ilAOn87qmgwGoz9ygsWHrCoK6YcY8jZ4QSIEC+a+W7cAmTWlQseo3KouKQYUzzSfjERkwtkhkh8yiaqNGxVXwjbjz+CUZJj4iubSOpI1f4o7mhwnDg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:to:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:content-transfer-encoding:in-reply-to:user-agent:from; b=G/WDK7AGlhHR1Pw5JBo5smMhUHBqdAQHmpR5YyC88QnbQ2xvZobcAUw+54ibOhyyMjX1B4tBTAuOozmuZJbfacX1bPOG/4NV8CbElvuUuoXqNWiqVFSSXtWmeODfxBlcMFSTUa1z4pAMoRgQKNW6LFJN4gSN02UrOgRESP20kT4= Date: Mon, 4 Feb 2008 23:04:21 +0100 To: lablgtk at yquem.inria.fr Subject: Re: [Lablgtk] List view : no scroll bar and maximum length ? Message-ID: <20080204220421.GA28520 at localhost> Mail-Followup-To: Julien Moutinho , lablgtk@yquem.inria.fr References: <666572260802041301p2bd86a20v9672abf9fa675de8 at mail.gmail.com> MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <666572260802041301p2bd86a20v9672abf9fa675de8 at mail.gmail.com> From: Julien Moutinho Content-Type: text/plain; charset=utf-8 Content-Length: 2536 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). >=20 > 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 ) >=20 > My interface looks like : http://ocaml.yaxm.org/files/blatere/pr11n.png > (1000 times the same file in order to see how it scaled) >=20 > 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 =20 -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" ~rend= erer:(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=C3=A8re' 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() funct= ion.) 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