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 257757 Details for
Bug 481485
[GTK3.10+] Paint listener for button/label does not work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Example snippet showing a button
ButtonPaintSnippet.java (text/x-java), 1.58 KB, created by
Michael Thonhauser
on 2015-11-05 09:39:12 EST
(
hide
)
Description:
Example snippet showing a button
Filename:
MIME Type:
Creator:
Michael Thonhauser
Created:
2015-11-05 09:39:12 EST
Size:
1.58 KB
patch
obsolete
>/******************************************************************************* > * Copyright (c) 2000, 2005 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >package snippets; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.PaintEvent; >import org.eclipse.swt.events.PaintListener; >import org.eclipse.swt.layout.GridData; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; > >public class ButtonPaintSnippet { > > public static void main(String[] args) { > Display display = new Display(); > Shell shell = new Shell(display); > shell.setLayout(new GridLayout()); > Button button = new Button(shell, SWT.PUSH); > button.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); > button.addPaintListener(new PaintListener() { > > public void paintControl(PaintEvent e) { > e.gc.drawString("Button", 100, 100, true); > } > }); > > shell.setSize(300, 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 481485
:
257748
| 257757 |
257758
|
257759