Dynamically change the parent without disposing the children [message #888724] |
Mon, 18 June 2012 10:46  |
Eclipse User |
|
|
|
Hi,
I got a situation where i need to create Labels[children] on Composite[parent].i am creating using the following code
for(wordnum = 0;wordnum<256;wordnum++)
{
word[wordnum] = new Label(composite, SWT.BORDER);
word[wordnum].setToolTipText(Integer.valueOf(wordnum+1).toString());
word[wordnum].setData(Integer.valueOf(wordnum+1).toString());
word[wordnum].setText(Integer.valueOf(wordnum+1).toString());
}
the layout for this composite is GridLayout.
when i select a value from combo box which is present in my UI.the labels should be ordered differently
Example: If the UI before selecting the option in combo box is
1 65 129 193 17 81 145 209 33 97 161 225 49 113 177 241
2 66 130 194 18 82 146 210 34 98 162 226 50 114 178 242
After selecting the value from combo box the UI should be
1 33 65 97 129 161 193 225 17 49 81 113 145 177 209 241
2 34 66 98 130 162 194 226 18 50 82 114 146 178 210 242
I am using the GridLayout ,here the problem is when i change the columns the values are displaying in a wrong way like this.
1 65 129 193 2 66 130 194 17 81 145 209 18 82 146 210
Please suggest me some solution.
Thanks in advance.
|
|
|
|
|
Re: Dynamically change the parent without disposing the children [message #890094 is a reply to message #889799] |
Thu, 21 June 2012 01:23  |
Eclipse User |
|
|
|
@jan Krakora ,
I am assigning TONS of data to each label before positioning , if i recreate the labels i have to reload the data and set that again,which might decrease my tool performance.
Thanks for the reply..
@Grant Gayed ,
I am iterating and setting the bounds for each label which solved my problem,but i am unable to stop the scroll bar,because i am using a composite over a scrolled composite and i am setting the size of composite dynamically.how can i restrict the scroll bar when the user can see all labels.
Thanks for the reply...
|
|
|
Powered by
FUDForum. Page generated in 0.04174 seconds