Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Draw SWT widget on SWT canvas
Draw SWT widget on SWT canvas [message #1094750] Mon, 26 August 2013 02:21 Go to next message
Li Chen is currently offline Li Chen
Messages: 20
Registered: July 2011
Location: Sydney
Junior Member
Hi, Just want to ask whether it is possible to draw an SWT widget (like a spinner) on an SWT canvas and specify x, y position in canvas to draw.
Thanks Smile
Re: Draw SWT widget on SWT canvas [message #1095388 is a reply to message #1094750] Mon, 26 August 2013 22:02 Go to previous message
Li Chen is currently offline Li Chen
Messages: 20
Registered: July 2011
Location: Sydney
Junior Member
Hi, I think I find out how to do it, first declare:
Button btn = new Button(canvas, SWT.PUSH);
then hide it, btn.setVisible(false);
and whenever you want to show it, first set the position:
btn.setBounds(x,y, width, height);
Then, btn.setVisible(true).
Previous Topic:JavaFX the easiest way to get a HTML5 browser in a SWT app?
Next Topic:Outlook E-Mail
Goto Forum:
  


Current Time: Sat Aug 02 00:44:27 EDT 2014

Powered by FUDForum. Page generated in 0.01675 seconds