Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Slider behaviour
Slider behaviour [message #448408] Sat, 08 January 2005 00:14 Go to next message
Eclipse UserFriend
Originally posted by: fleque.users.NoSpam.sourceforge.net

Hi all,

I have a question on a IMHO strange Slider behavior:
When I do
slider.setMinimun(0);
slider.setMaximun(1);
slider.setIncrement(1);
slider.setSelection(0);
I will get a Slider with a thumb filling all space, thus impossible to
move. As well I will not get any callback for a SelectionListener when I
use the buttons.
When I do
slider.setMinimun(0);
slider.setMaximun(2);
slider.setIncrement(1);
slider.setSelection(0);
I will get what I would expect from the first statements:
A thumb filling half of the space between the buttons. But here on the
callbacks for the buttons the value returned by slider.getSelection()
will either be 0 or 1.
So the slider never reaches its maximum value.
Is this the intendet behaviour?
Is this behaviour platform dependent? (I am on SuSE Linux 9.1)

Regards Alex
Re: Slider behaviour [message #448446 is a reply to message #448408] Mon, 10 January 2005 12:25 Go to previous message
Charlie Surface is currently offline Charlie SurfaceFriend
Messages: 40
Registered: July 2009
Member
Yes, this is correct, although it is slightly non-intuitive. The
maximum value that the Slider can return is max - thumb size
(get/setThumb), which is the length of the scroll thumb. This behavior
should be identical on all platforms.

Charlie


Fleque wrote:

> Hi all,
>
> I have a question on a IMHO strange Slider behavior:
> When I do
> slider.setMinimun(0);
> slider.setMaximun(1);
> slider.setIncrement(1);
> slider.setSelection(0);
> I will get a Slider with a thumb filling all space, thus impossible to
> move. As well I will not get any callback for a SelectionListener when I
> use the buttons.
> When I do
> slider.setMinimun(0);
> slider.setMaximun(2);
> slider.setIncrement(1);
> slider.setSelection(0);
> I will get what I would expect from the first statements:
> A thumb filling half of the space between the buttons. But here on the
> callbacks for the buttons the value returned by slider.getSelection()
> will either be 0 or 1.
> So the slider never reaches its maximum value.
> Is this the intendet behaviour?
> Is this behaviour platform dependent? (I am on SuSE Linux 9.1)
>
> Regards Alex
Previous Topic:How to launch a java program (having swt comp) in browser
Next Topic:Where must i install J9VM in Pocket PC ?
Goto Forum:
  


Current Time: Tue Oct 27 22:31:26 GMT 2020

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

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

Back to the top