|
Re: how to force refresh on a Composite? [message #118260 is a reply to message #118232] |
Mon, 12 January 2009 11:00 |
|
Hi David,
ScrolledComposites are tricky and they are many ways to go wrong. I'd
recommend experimenting with a simple snippet in SWT first. If you have
a snippet that works with SWT and doesn't with RWT, feel free to file a
bug, then we can look into it.
Best regards, Ralf
David Donohue wrote:
> Hello! I have created a custom control, which extends Composite (anc
> contains a ScrolledComposite). It generates a table of data and/or form
> controls. I am having trouble refreshing this control. When I change
> the control's data and layout(), my control is invisible. If however I
> resize the screen, it shows up! How can I force my composite to show
> up? My controlResized() is below.
> scrolledComposite.addControlListener(new ControlAdapter() {
> public void controlResized(ControlEvent e) {
>
> scrolledComposite.setMinSize(scrolledComposite.computeSize(S WT.DEFAULT,
> SWT.DEFAULT));
> }
> });
>
> Within my control's code, I try to force a refresh by calling the same
> method
> scrolledComposite.setMinSize(scrolledComposite.computeSize(S WT.DEFAULT,
> SWT.DEFAULT));
> but that fails as well.
>
> Thanks!
> David Donohue
>
|
|
|
|
|
|
Re: how to force refresh on a Composite? [message #118757 is a reply to message #118612] |
Mon, 19 January 2009 16:06 |
|
Hi David,
I'm sorry, but I don't understand what you exactly doing from your
description. Please provide a complete and *simple* snippet to reproduce
the problem and please make sure that your code works with SWT.
BTW, there's no use setting a layout on a SC, as it manages its own
layout. This statement is simply ignored.
Regards, Ralf
David Donohue wrote:
> Ralf,
> Just to follow up on this problem. I figured out that the intermittent
> vanishing of my ScrolledComposite occurs when its contents have the same
> content as before. Example: Render in my composite results 1-10 ... OK
> Render in my composite results 11-20 ... OK
> Go BACK and render in my composite results 1-10 again ... Blank, until I
> resize
> Go FORWARD and render in my composite results 21-30 ... OK
>
> This workaround works for me: After my ScrolledComposite (in the a
> different composite was added just after the ScrolledComposite) I add a
> blank composite, with random content. Now my ScrolledComposite shows up
> every time.
>
> scrolledComposite = new ScrolledComposite(container, SWT.V_SCROLL |
> SWT.H_SCROLL);
> scrolledComposite.setLayout(new GridLayout(1, true));
>
> unscrolledBottomComposite = new Composite(container, SWT.NONE);
> Text hiddenText = new Text(unscrolledBottomComposite, SWT.NONE);
> hiddenText.setVisible(false);
> hiddenText.setText(UUID.randomUUID().toString());
>
> David Donohue
>
|
|
|
Powered by
FUDForum. Page generated in 0.03408 seconds