StackLayout problem [message #466751] |
Tue, 17 January 2006 12:46 |
Eclipse User |
|
|
|
Originally posted by: clau349.hotmail.com
I got a tree and i use a StackLayout to show the properties of each item of my tree... My StackLayout code is:
StackLayout stack = new StackLayout();
composite.setLayout(stack);
Group[] group = new Group[1];
group[0] = new Group(composite,SWT.NONE);
group[0].setText(string);
GridLayout gl = new GridLayout();
group[0].setLayout(gl);
Label l = new Label(group[0],SWT.NONE);
l.setText("Name");
Text b = new Text(group[0], SWT.NONE);
b.setLayoutData(new GridData (GridData.FILL_HORIZONTAL));
b.setText(string);
stack.topControl = group[0];
But when I call for the method several times or clicked many items in my tree, eclipse throws me:
Unhandled event loop exception
Reason:
No more handles
I think This is because when a i clik a item i create a new Stacklayout, but when i click another one item another Stacklayout is created and so on. But StackLayouts created before doesn`t be destroyed so the memory can´t handle it...
There is some way to destroy the Stacklayouts that i do not use or somenthing...
Thank for help me out
|
|
|
|
Re: StackLayout problem [message #466797 is a reply to message #466762] |
Tue, 17 January 2006 19:10 |
Eclipse User |
|
|
|
Originally posted by: clau349.hotmail.com
yeah.. you are right, I can use a fillLayout but the problem is that when i click a item in my tree, my StackLayout or FillLayout shows me the properties of my tree´s item like a label with my tree item name for example, but when i click another item then i got 2 labels, when i click another item i got 3 labels and so on. That my problem, i cannot erase the labels that i do not use anymore.
I call the method from my:
public void propertyChange(PropertyChangeEvent evt )
So i can refresh when i clicked en my tree item directly.
When i use the next code:
Control[] d = this.composite.getChildren();
System.out.println(d.lenght);
I can see that "d" stores the children... it starts with 1,2,3..... (I got the same numbers of labels in my application)when it arrives about 3000, throws me a handle error...
It must be a way to control that but could not be possible for me..
Thanks for any help you can give me....
|
|
|
|
Powered by
FUDForum. Page generated in 0.03262 seconds