|
|
|
Re: Widgets not shown until the shell is resized [message #446194 is a reply to message #446180] |
Fri, 19 November 2004 21:28 |
Mark McLaren Messages: 45 Registered: July 2009 |
Member |
|
|
Thanks for the response, but it turned out to be a much simpler fix: call
getShell().setSize() after adding the widgets to the panel.
Mark
Veronika Irvine wrote:
> The way Composite.layout(true) works is that the composite you call it on
> (panel in your case) will update the size and location of its direct
> children. If any of the children are resized as a result of this action,
> the resized child will also have a layout performed. However, the following
> conditions apply 1) the child must have a Layout assigned to it and 2) the
> cache will not be flushed (equivalent of calling (layout(false)). If a
> child does not change size, it will not get laid out. What often happens is
> that there will be some Composite that has a fixed size (call it C). If you
> make a change to a child of C then call layout(true) on any of the parents
> of C, nothing will get laid out in C. You must call layout(true) on C.
> In 3.1 we are adding new API to make this easier. See
> Composite.layout(boolean changed, boolean all) and
> Composite.layout(Control[]).
> "Christian Hauser" <c.hauser@active.ch> wrote in message
> news:cnjbjq$l7g$1@www.eclipse.org...
>> Mark McLaren wrote:
>>> I'm finding my widgets aren't being displayed until I resize the shell
>>> they are in - then suddenly they appear!
>>>
>>> What method do I need to call to make them appear? These don't seem to
>>> work:
>>> panel.layout(true) panel.getShell().redraw()
>>
>> What happens if you call panel.getShell().layout(true)? Try calling
>> layout(true) on different panels to see if it makes a difference.
>>
>> Had this problem, too, some time ago and layout(true) on the right
>> composite helped.
>>
>> HTH,
>> Christian
|
|
|
Re: Widgets not shown until the shell is resized [message #446202 is a reply to message #446194] |
Fri, 19 November 2004 23:02 |
Daniel Spiewak Messages: 263 Registered: July 2009 |
Senior Member |
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Luxi Sans"><font face="serif">Both fixes are more or less
the same. Except for the fact that I like to set the Shell size in the
constructor, that'd be pretty good. I'm rather pleased that 3.1 will
include a better way of doing this. I'm rather pleased with the SWT
3.1 effort altogether. Way to go guys!<br>
<br>
Daniel</font><br>
</font><br>
Mark McLaren wrote:
<blockquote cite="midcnloih$7iq$1@www.eclipse.org" type="cite">Thanks
for the response, but it turned out to be a much simpler fix: call
getShell().setSize() after adding the widgets to the panel.
<br>
<br>
Mark
<br>
<br>
Veronika Irvine wrote:
<br>
<br>
<blockquote type="cite">The way Composite.layout(true) works is that
the composite you call it on (panel in your case) will update the size
and location of its direct children. If any of the children are
resized as a result of this action, the resized child will also have a
layout performed. However, the following conditions apply 1) the child
must have a Layout assigned to it and 2) the cache will not be flushed
(equivalent of calling (layout(false)). If a child does not change
size, it will not get laid out. What often happens is that there will
be some Composite that has a fixed size (call it C). If you make a
change to a child of C then call layout(true) on any of the parents of
C, nothing will get laid out in C. You must call layout(true) on C.
<br>
</blockquote>
<br>
<blockquote type="cite">In 3.1 we are adding new API to make this
easier. See Composite.layout(boolean changed, boolean all) and
Composite.layout(Control[]).
<br>
</blockquote>
<br>
<blockquote type="cite">"Christian Hauser" <a class="moz-txt-link-rfc2396E" href="mailto:c.hauser@active.ch"><c.hauser@active.ch></a>
wrote in message <a class="moz-txt-link-freetext" href="news:cnjbjq$l7g$1@www.eclipse.org">news:cnjbjq$l7g$1@www.eclipse.org</a>...
<br>
<blockquote type="cite">Mark McLaren wrote:
<br>
<blockquote type="cite">I'm finding my widgets aren't being
displayed until I resize the shell they are in - then suddenly they
appear!
<br>
<br>
What method do I need to call to make them appear? These don't seem to
work:
<br>
panel.layout(true) panel.getShell().redraw()
<br>
</blockquote>
<br>
What happens if you call panel.getShell().layout(true)? Try calling
layout(true) on different panels to see if it makes a difference.
<br>
<br>
Had this problem, too, some time ago and layout(true) on the right
composite helped.
<br>
<br>
HTH,
<br>
Christian
<br>
</blockquote>
</blockquote>
<br>
<br>
</blockquote>
</body>
</html>
|
|
|
Powered by
FUDForum. Page generated in 0.02326 seconds