How to determine which layout() method I should call ? [message #516323] |
Tue, 23 February 2010 15:38 |
H.ORTIZ Messages: 22 Registered: July 2009 |
Junior Member |
|
|
Hi,
To simplify, I can say that my application consists in a Shell divided vertically in two parts: on the left there is a selection tree containing several items and on the right a Composite using a StackLayout. When the user clickes on a tree item, the composite on the right displays a specific composite.
Once an item has been chosen, its associated composite will be present as long as the application runs in the StackLayout. So, when the user has clicked on most of the tree items, there is a lot of composites stored in the StackLayout.
My refresh method consists in calling:
and I noticed that the execution time of this method is increasing with the number of "stacked" composites. It seems like this method refreshes also "hidden" composites and not only the one on the top of the stack.
My question is: which layout method (and with which parameters) of the Shell class should I use to avoid this problem ?
Thanks,
Helene
[Updated on: Tue, 23 February 2010 15:40] Report message to a moderator
|
|
|
Re: How to determine which layout() method I should call ? [message #516359 is a reply to message #516323] |
Tue, 23 February 2010 17:21 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
Why are you doing Shell.layout(true,true)
all u need to do is
stacklayout.topcontrol=selectedComposite;
shell.layout();
by the way having a composite for each tree element is a bit too heavy..try to fix that...
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
|
|
Re: How to determine which layout() method I should call ? [message #516874 is a reply to message #516870] |
Thu, 25 February 2010 12:30 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
when ever you know that you changed somthing on your control like adding,removing or size increase/decreasing you should call layout(true) layout(true,true)
Difference between layout(true) layout(true,true)
is self evident from java doc...
layout(true,true) recursively calculates the childrens layout also negating catched layout info...
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
[Updated on: Thu, 25 February 2010 12:34] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03231 seconds