Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » GC Can Not DrawFocus On Window 7 64Bit
GC Can Not DrawFocus On Window 7 64Bit [message #694891] Sun, 10 July 2011 05:57 Go to next message
sunchaoqun  is currently offline sunchaoqun
Messages: 1
Registered: July 2011
Junior Member
Hi,
Is there anybody knows why the GC can not drawFocus on Window 7(Is it a bug),it works fine on WindowXP,my source code below:

package org.scq.test;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class DrawFocusRectangle {
  public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setText("Canvas Example");
    shell.setLayout(new FillLayout());

    Canvas canvas = new Canvas(shell, SWT.NONE);

    canvas.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent e) {
        e.gc.setForeground(e.display.getSystemColor(SWT.COLOR_RED));
        e.gc.drawFocus(5, 5, 200,10);
      }
    });

    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
    display.dispose();
  }
} 
Re: GC Can Not DrawFocus On Window 7 64Bit [message #695711 is a reply to message #694891] Tue, 12 July 2011 11:39 Go to previous message
Lakshmi Shanmugam
Messages: 274
Registered: July 2009
Location: India
Senior Member
Hi,

I don't have Windows 7 so I'm unable to test your snippet. Please open a bug report with SWT here so that it can be investigated --> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform &component=SWT

Thanks!


Lakshmi P Shanmugam
Previous Topic:Paint Event triggered by Verify Event
Next Topic:Certain objects refuse to appear in pop-up
Goto Forum:
  


Current Time: Fri Oct 24 15:44:51 GMT 2014

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

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