[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Widget Position According to the User Needs

Dante Torres wrote:
Hi guys,

I would like to change the ordering/position of the widgets in a composite after the composite creation. For instance, I have a composite that displays (from top to down) a button, a table and a tree (they appear in this order). How can I allow the application user to change that order (e.g. table, tree, button)?

Do I have to do it manually, like re-setting the position of each widget? Or can I do it via layout? Do I have to create another composite and remove the old one? Or is there any other way?

For that kind of thing I would recommend using the FormLayout. It is a bit more complex and takes longer to learn than the others, but I think it is the only one that does not depend on the order in which the widgets were added to the parent. In other words, it will allow you to dynamically re-arrange the widgets after they have been created.
Remember that when you change the layout datas for the widgets (to re-position them) you'll need to call layout() on the parent Composite.


Hope this helps,
	Eric