Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 278188 Details for
Bug 546248
[GTK3] Composite receives to much repaint events
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Sample code to reproduce
RepaintEvents.java (text/plain), 1.42 KB, created by
Thomas Singer
on 2019-04-09 10:32:20 EDT
(
hide
)
Description:
Sample code to reproduce
Filename:
MIME Type:
Creator:
Thomas Singer
Created:
2019-04-09 10:32:20 EDT
Size:
1.42 KB
patch
obsolete
>import java.text.*; >import java.util.*; >import java.util.List; > >import org.eclipse.swt.*; >import org.eclipse.swt.layout.*; >import org.eclipse.swt.widgets.*; > >public class RepaintEvents { > > public static void main(String[] args) { > final Display display = new Display(); > > final StringBuilder buffer = new StringBuilder(); > > final int period = 250; > display.timerExec(period, new Runnable() { > @Override > public void run() { > if (buffer.length() > 0) { > System.out.println(DateFormat.getTimeInstance().format(new Date()) + ": " + buffer); > buffer.setLength(0); > } > if (!display.isDisposed()) { > display.timerExec(period, this); > } > } > }); > > final Shell shell = new Shell(display); > shell.setLayout(new FillLayout()); > > final Composite composite = new Composite(shell, SWT.DOUBLE_BUFFERED | SWT.V_SCROLL); > final Listener listener = event -> { > if (event.type == SWT.Paint) { > buffer.append('p'); > event.gc.drawText("Hello world", 0, 0); > } > else if (event.type == SWT.MouseMove) { > buffer.append('m'); > } > else if (event.type == SWT.MouseHover) { > buffer.append('h'); > } > }; > composite.addListener(SWT.Paint, listener); > composite.addListener(SWT.MouseMove, listener); > composite.addListener(SWT.MouseHover, listener); > > shell.setSize(400, 300); > shell.open(); > > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) { > display.sleep(); > } > } > > display.dispose(); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 546248
: 278188