This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gui] [PATCH] Fix List peer's native getSize() method


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]