This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [gui] [PATCH] Fix List peer's native getSize() method
- From: Thomas Fitzsimmons <fitzsim at redhat dot com>
- To: David Jee <djee at redhat dot com>
- Cc: libgcj patches <java-patches at gcc dot gnu dot org>
- Date: Tue, 25 May 2004 14:05:36 -0400
- Subject: Re: [gui] [PATCH] Fix List peer's native getSize() method
- References: <1085498757.17250.4.camel@tomboy.toronto.redhat.com>
On Tue, 2004-05-25 at 11:25, David Jee wrote:
> Hello,
>
> I committed the following patch to the java-gui-branch. It fixes List
> peer's native getSize() method, so that it properly queries for the
> widget's natural size. The patch also fixes a bug in GtkComponentPeer's
> constructor, which was preventing component peers from receiving
> setBounds() calls.
>
Hi,
> + /* Calculate the final height, by comparing the number of rows
> + in the list to the number of rows requested by the caller.
> + FIXME: Is there a GTK method that counts the number of rows
> + in the list? If so, we don't need to bring visible_rows from
> + the Java peer. */
GTK doesn't provide a convenient way to find the number of visible
rows. I think your approach is fine, so this FIXME can be removed.
> + if (rows == visible_rows)
> + dims[1] = natural_req.height;
> + else
> + dims[1] = natural_req.height / visible_rows * rows;
This isn't going to work when there is a horizontal scrollbar on the
list. You'll need to add a function like
GtkTextAreaPeer.getHScrollbarHeight here.
Tom