Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to add Text Item to Toolbar
How to add Text Item to Toolbar [message #463233] Wed, 02 November 2005 04:49 Go to next message
Eclipse UserFriend
Originally posted by: siegfried.heintze.com

I'm looking at the
http://download.eclipse.org/eclipse/downloads/documentation/ 2.0/html/plugins/org.eclipse.platform.doc.isv/reference/api/ org/eclipse/swt/widgets/ToolItem.html
and the styles only include
PUSH, CHECK, RADIO, SEPARATOR, DROP_DOWN
Is there not a way to add a text box?

Thanks,
Siegfried
Re: How to add Text Item to Toolbar [message #463285 is a reply to message #463233] Wed, 02 November 2005 13:15 Go to previous message
Eclipse UserFriend
Originally posted by: hsk2840.gmail.com

> Is there not a way to add a text box?

I did something like this:

ToolItem sep = new ToolItem(toolbar, SWT.SEPARATOR);
Text text = new Text(toolbar, SWT.BORDER);
text.setText(" ");
text.pack();
text.setText("");
sep.setWidth(text.getSize().x);
sep.setControl(text);

Well... It works for me, maybe there is a better solution :-)

Henrik
Previous Topic:Write Own Event Listeners
Next Topic:How to have tooltip displayed on a table cell in a table item?
Goto Forum:
  


Current Time: Thu Nov 27 21:07:45 GMT 2014

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

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