Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » wrong visible table entry
wrong visible table entry [message #524448] Wed, 31 March 2010 20:46 Go to next message
matt murphy is currently offline matt murphyFriend
Messages: 21
Registered: July 2009
Junior Member
public int getTopmostVisibleItem() {

final int itemCount = _swtTree.getItemCount();

if(_swtTree.getTopItem() == null ) return 0;

return (itemCount==0) ? 0 : _swtTree.indexOf(_swtTree.getTopItem());

}

I'm attempting to obtain the top most visible item from my Tree with the
code above. The code works fine on windows when i scroll I obtain the
topmost time. Unfortunately on linux I don't receive the top most item I
receive the topmost item -1 ? Is this a known problem on linux? I didn't
see anything in bugzilla .

thanks,

matt
Re: wrong visible table entry [message #524572 is a reply to message #524448] Thu, 01 April 2010 13:15 Go to previous messageGo to next message
Ralf Ebert is currently offline Ralf EbertFriend
Messages: 168
Registered: July 2009
Senior Member
Hi Matt,

it might be a partial visible item at top, partial items might be handled in a
platform-dependent way. Can't check it under Linux atm, but on OS X there is a "TODO -
partial item at the top" right at the top of the getTopItem() method :) If that turns out
to be the problem, you should probably file a bug to clarify the JavaDoc with information
if the top item can be partially visible or if you can expect to get a fully visible item.

Could also be:
Bug 202120 - Tree#getTopItem() returns wrong item if event-queue not flushed before
http://bugs.eclipse.org/202120

Greetings,

Ralf



--
http://www.ralfebert.de/blog/
http://twitter.com/ralfebert/
Re: wrong visible table entry [message #524683 is a reply to message #524572] Thu, 01 April 2010 19:02 Go to previous messageGo to next message
matt murphy is currently offline matt murphyFriend
Messages: 21
Registered: July 2009
Junior Member
Hi Ralf ,

thanks that got me linked into the right set of bugs. I don't see the TODO
on linux.
Bug 74739 - Table getTopIndex does not return correct value after
setTopIndex before shell is opened
and enhancement request
Bug 83335 - Table on Linux-GTK+ should support scrolling by item (not by
pixel)

I'm looking for a work around now and tried setting the scroll bar increment
but that doesn't have any effect on linux.

Matt


"Ralf Ebert" <info@ralfebert.de> wrote in message
news:hp269l$h6l$2@build.eclipse.org...
> Hi Matt,
>
> it might be a partial visible item at top, partial items might be handled
> in a platform-dependent way. Can't check it under Linux atm, but on OS X
> there is a "TODO - partial item at the top" right at the top of the
> getTopItem() method :) If that turns out to be the problem, you should
> probably file a bug to clarify the JavaDoc with information if the top
> item can be partially visible or if you can expect to get a fully visible
> item.
>
> Could also be:
> Bug 202120 - Tree#getTopItem() returns wrong item if event-queue not
> flushed before
> http://bugs.eclipse.org/202120
>
> Greetings,
>
> Ralf
>
>
>
> --
> http://www.ralfebert.de/blog/
> http://twitter.com/ralfebert/
Re: wrong visible table entry [message #524687 is a reply to message #524683] Thu, 01 April 2010 19:06 Go to previous message
matt murphy is currently offline matt murphyFriend
Messages: 21
Registered: July 2009
Junior Member
By the way, This problem is for tree . You can see the issues with the
snippet
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet254.java?view=co


"matt murphy" <murphy@coherentlogix.com> wrote in message
news:hp2qk0$cna$1@build.eclipse.org...
> Hi Ralf ,
>
> thanks that got me linked into the right set of bugs. I don't see the TODO
> on linux.
> Bug 74739 - Table getTopIndex does not return correct value after
> setTopIndex before shell is opened
> and enhancement request
> Bug 83335 - Table on Linux-GTK+ should support scrolling by item (not by
> pixel)
>
> I'm looking for a work around now and tried setting the scroll bar
> increment but that doesn't have any effect on linux.
>
> Matt
>
>
> "Ralf Ebert" <info@ralfebert.de> wrote in message
> news:hp269l$h6l$2@build.eclipse.org...
>> Hi Matt,
>>
>> it might be a partial visible item at top, partial items might be handled
>> in a platform-dependent way. Can't check it under Linux atm, but on OS X
>> there is a "TODO - partial item at the top" right at the top of the
>> getTopItem() method :) If that turns out to be the problem, you should
>> probably file a bug to clarify the JavaDoc with information if the top
>> item can be partially visible or if you can expect to get a fully visible
>> item.
>>
>> Could also be:
>> Bug 202120 - Tree#getTopItem() returns wrong item if event-queue not
>> flushed before
>> http://bugs.eclipse.org/202120
>>
>> Greetings,
>>
>> Ralf
>>
>>
>>
>> --
>> http://www.ralfebert.de/blog/
>> http://twitter.com/ralfebert/
>
>
Previous Topic:embedded debugger in SWT browser
Next Topic:Maintaining a TreeView expansion state after setInput()
Goto Forum:
  


Current Time: Sat Dec 07 03:37:27 GMT 2024

Powered by FUDForum. Page generated in 0.04533 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top