org.eclipse.swt.widgets.Tracker [message #523223] |
Thu, 25 March 2010 10:59  |
Eclipse User |
|
|
|
I am using a Tracker in Windows and everything is OK so far.
As soon as I use a Suse Linux distribution (KDE)I get some strange
behavior of this tracker. I am using a NX Client, to connect to this
Suse maschine.
The tracker is going to resize itself, like i move the mouse (what i am
not doing)
Has anybody else been confronted with this ? And if so, how did you
solve it ?
THX
Andreas
|
|
|
|
Re: org.eclipse.swt.widgets.Tracker [message #524494 is a reply to message #523363] |
Wed, 31 March 2010 22:50   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------010809040301010803000601
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Am 26.03.2010 09:00, schrieb Praveen:
> Andreas Schmid wrote:
>> The tracker is going to resize itself, like i move the mouse (what i
>> am not doing)
> I mostly use NX client for connecting to my Ubuntu machine and I have
> never seen such problem with Tracker. Can you point me to a SWT code
> snippet you are trying to work with Tracker, so that I shall try to
> reproduce your scenario here ?
Sorry for the late reply.
I just created this Snippet for you. Hope you can reproduce the behavior.
Thanks
Andreas
--------------010809040301010803000601
Content-Type: text/plain;
name="TrackerSnippet.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="TrackerSnippet.java"
package de.it4vet.snippets
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tracker;
/**
* Short snippet to show missbehavior of Tracker under NX Client
* As long as i use MS it works. But if i am running it under NX Client and
* a Suse OS, the tracker is Moving like I move the mouse what i am not doing.
* It doesn't happen all the time.. Mostly it happens wenn i move the mouse quite
* fast.
* @author <a href="andreas@schmid-solutions.de">Andreas Schmid</a>
* @since 01.04.2010
*/
public class TrackerSnippet {
private static Tracker tracker;
private static Display display;
private static Shell shell;
private static final MouseListener trackerListener = new MouseAdapter(){
public void mouseDown(MouseEvent event) {
if(event.button == 1){
Rectangle rect = display.map((Control) event.widget, shell, event.x, event.y, 0, 0);
tracker.setRectangles(new Rectangle[] { rect });
tracker.open();
}
}
};
public static void main(String[] args) {
display = new Display();
shell = new Shell(display);
tracker = new Tracker(shell, SWT.RESIZE);
for (int a = 0; a < 9; a++) {
Group g = new Group(shell, SWT.BORDER);
g.setText("Group" + a);
g.setLayout(new GridLayout(3, true));
for (int b = 0; b < 9; b++) {
Label label = new Label(g, SWT.BORDER);
label.setText("Label: " + b);
label.addMouseListener(trackerListener);
}
g.addMouseListener(trackerListener);
}
GridLayout layout = new GridLayout(3, true);
shell.setLayout(layout);
shell.pack();
shell.addMouseListener(trackerListener);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
--------------010809040301010803000601--
|
|
|
Re: org.eclipse.swt.widgets.Tracker [message #526224 is a reply to message #524494] |
Fri, 09 April 2010 05:29  |
Eclipse User |
|
|
|
Any updates ?
Thanks
Andreas
Am 01.04.2010 09:40, schrieb Andreas Schmid:
> Am 26.03.2010 09:00, schrieb Praveen:
>> Andreas Schmid wrote:
>>> The tracker is going to resize itself, like i move the mouse (what i
>>> am not doing)
>> I mostly use NX client for connecting to my Ubuntu machine and I have
>> never seen such problem with Tracker. Can you point me to a SWT code
>> snippet you are trying to work with Tracker, so that I shall try to
>> reproduce your scenario here ?
>
> Sorry for the late reply.
>
> I just created this Snippet for you. Hope you can reproduce the behavior.
>
> Thanks
>
> Andreas
|
|
|
Powered by
FUDForum. Page generated in 0.25936 seconds