Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » adding a button to a composite at position x
adding a button to a composite at position x [message #661156] Wed, 23 March 2011 12:04 Go to next message
GRudiD  is currently offline GRudiD Friend
Messages: 2
Registered: March 2011
Junior Member
Hello,

i created a composite with 10 buttons. After that i tried to add a new button to this composite at first position (index 0, or somwhere else). I have no idea how to do this.
The button has no constructor with a index and the composite has no methods to rearrange its children. The only way i found out is to dispose all buttons and create them again. But this is not a good way i think.
How can i solve this problem.
Re: adding a button to a composite at position x [message #661371 is a reply to message #661156] Thu, 24 March 2011 12:33 Go to previous messageGo to next message
Lakshmi P ShanmugamFriend
Messages: 279
Registered: July 2009
Location: India
Senior Member
Hi,

You can use Control.moveAbove() and Control.moveBelow() to rearrange the controls. Here is an example snippet --> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet6.j ava

HTH,


Lakshmi P Shanmugam
Re: adding a button to a composite at position x [message #661718 is a reply to message #661156] Sat, 26 March 2011 16:26 Go to previous message
GRudiD  is currently offline GRudiD Friend
Messages: 2
Registered: March 2011
Junior Member
Oh, so easy? Thanks for help.
Previous Topic:How do I scroll to the bottom of HTML in a browser control?
Next Topic:On "Save All" operation, message on status bar is not being displayed
Goto Forum:
  


Current Time: Thu Apr 25 01:43:06 GMT 2024

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

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

Back to the top