Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to revalidate layout?
How to revalidate layout? [message #734056] Thu, 06 October 2011 14:32 Go to next message
Johannes Lerch is currently offline Johannes LerchFriend
Messages: 18
Registered: February 2011
Junior Member
Hi,

I'm using a browser widget which I always want to have the size it needs to show the whole html page. That's not possible by default, but I am able to update the size after rendering by using a small java-script function.
Anyway, that's not the problem. My problem is that I have to relayout parts of my component hierarchy when the size of the browser widget changes. I managed to do that by calling layout(true, true) on each of the browsers parents, but I guess that's not very smart and does a lot more relayouts than needed. Calling layout only on the direct parent of the browser widget does not work and I think layouting must be at least propagated up the hierarchy to a ScrolledComposite or something similar.
I found a solution that works by doing this on stackoverflow: http://stackoverflow.com/questions/586414/why-does-an-swt-composite-sometimes-require-a-call-to-resize-to-layout-correctl/686610#686610
But I think that should be a common problem and if that's really the right solution: Isn't there a util function already located in SWT to do that?

Thanks,
Johannes
Re: How to revalidate layout? [message #735215 is a reply to message #734056] Tue, 11 October 2011 09:21 Go to previous messageGo to next message
Lakshmi P ShanmugamFriend
Messages: 279
Registered: July 2009
Location: India
Senior Member
Hi,
The last reply in the same thread explains the right solution --> http://stackoverflow.com/questions/586414/why-does-an-swt-composite-sometimes-require-a-call-to-resize-to-layout-correctl/586620#586620.
Does it not work for you?


Lakshmi P Shanmugam
Re: How to revalidate layout? [message #735264 is a reply to message #735215] Tue, 11 October 2011 11:20 Go to previous message
Johannes Lerch is currently offline Johannes LerchFriend
Messages: 18
Registered: February 2011
Junior Member
As far as i understand the last reply, it is exactly the same what I outlined as working solution. I'm just wondering that there is no function doing the layout propagation until it reaches a scrollable composite. If that's the default step to do in this situation then there should be a utility function. Otherwise all developers have to reimplement it. That's why I'm not sure that it is the right way.
Previous Topic:Background color of a deselected table/tree item
Next Topic:KTable Composite cell renderer
Goto Forum:
  


Current Time: Fri Apr 19 00:24:47 GMT 2024

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

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

Back to the top