Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] MouseEvent Question

I predict your Composite isn't really being set to size 500 x 90,000. You should try and getSize() after the set and see what size it really is - I bet Java's not giving you the size you asked for. Is there a return from setSize() that tells you if it succeeded? I can't remember.

-- Nathan
Correspondence
---------------------------------------------------------------------
Nathan DeBardeleben, Ph.D.
Los Alamos National Laboratory
Parallel Tools Team
High Performance Computing Environments
phone: 505-667-3428
email: ndebard@xxxxxxxx
---------------------------------------------------------------------



Clement CHU wrote:

Hi,
I got a problem on the value of Event.y. For example, SrcolledComposite sc = new ScrolledComposite(parent, SWT.V_SCROLL);
 sc.setLayout(new FillLayout());
 sc.setLayoutData(new GridData(GridData.Fill_BOTH);
Composite co = new Composite(sc, SWT.NONE);
 co.setLayout(new FillLayout());
 co.setLayoutData(new GridData(GridData.Fill_BOTH);
 sc.setContent(co);
co.setSize(500, 90000); co.addListener(SWT.MouseDown, new Listener() {
    public void handleEvent(Event e) {
      System.out.println("Y: " + e.y);
    }
 )};
The output of Y is 32267 when I scolled to the bottom and clicked on the bottom line. If I set the height of co under 30000, there is no that problem. The mouse event can show the accurate y location of mouse. Have you got any idea of it? Clement

------------------------------------------------------------------------

_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev


Back to the top