Skip to main content



      Home
Home » Archived » Visual Editor (VE) » SWT Application Does Not Display Correctly Until Resized.
SWT Application Does Not Display Correctly Until Resized. [message #63995] Sun, 03 October 2004 07:35 Go to next message
Eclipse UserFriend
Originally posted by: eraserman.nospam.gmail.com

Hello,

I just started experimenting with Visual Editor. I created
a simple application using SWT. This application looks correct
when editing it with the visual editor, however, when I run it,
It does not look right, there is a multiple-line text field, it is
the only widget to show when the application is first run. After
resizing the app, all widgets display correctly. Any ideas on how
to fix this?

The code in question follows, it was generated by Visual
Editor 100% (no hand coding). I am writing and testing
using Linux/GTK. I haven't had a chance to test this under
any other platforms.

/*
* Created on Oct 3, 2004
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package net.heffelfinger.vetest;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Button;
/**
* @author ray
*
* TODO To change the template for this generated type comment go to Window -
* Preferences - Java - Code Style - Code Templates
*/
public class VisualEditorTest
{

private org.eclipse.swt.widgets.Shell sShell = null; // @jve:decl-index=0:visual-constraint="0,10"

private Label label = null;

private Text text = null;

private Label label1 = null;

private Text text1 = null;

private Label label2 = null;
private Composite composite = null;
private Button radioButton = null;
private Button radioButton1 = null;
private Button radioButton2 = null;
private Label label3 = null;
private Composite composite1 = null;
private Button checkBox = null;
private Button checkBox1 = null;
private Button checkBox2 = null;
private Button checkBox3 = null;
private Button checkBox4 = null;
private Button checkBox5 = null;
private Button checkBox6 = null;
private Button checkBox7 = null;
/**
* This method initializes composite
*
*/
private void createComposite() {
GridData gridData11 = new GridData();
GridData gridData10 = new GridData();
GridData gridData9 = new GridData();
GridData gridData8 = new GridData();
GridLayout gridLayout7 = new GridLayout();
composite = new Composite(sShell, SWT.NONE);
radioButton = new Button(composite, SWT.RADIO);
radioButton1 = new Button(composite, SWT.RADIO);
radioButton2 = new Button(composite, SWT.RADIO);

composite.setLayout(gridLayout7);
composite.setLayoutData(gridData8);
gridData8.heightHint = 25;
gridData8.widthHint = 400;
gridData8.grabExcessHorizontalSpace = true;
radioButton.setText("Pan");
radioButton.setLayoutData(gridData9);
gridData9.widthHint = 50;
gridLayout7.numColumns = 3;
gridLayout7.makeColumnsEqualWidth = false;
radioButton1.setText("Hand Tossed");
radioButton1.setLayoutData(gridData10);
gridData10.widthHint = 110;
radioButton2.setText("Thin and Crispy");
radioButton2.setLayoutData(gridData11);
gridData11.widthHint = 130;
}
/**
* This method initializes composite1
*
*/
private void createComposite1() {
GridData gridData22 = new GridData();
GridData gridData21 = new GridData();
GridData gridData20 = new GridData();
GridData gridData19 = new GridData();
GridData gridData18 = new GridData();
GridData gridData17 = new GridData();
GridData gridData16 = new GridData();
GridData gridData15 = new GridData();
GridData gridData14 = new GridData();
GridLayout gridLayout13 = new GridLayout();
composite1 = new Composite(sShell, SWT.NONE);
checkBox = new Button(composite1, SWT.CHECK);
checkBox1 = new Button(composite1, SWT.CHECK);
checkBox2 = new Button(composite1, SWT.CHECK);
checkBox3 = new Button(composite1, SWT.CHECK);
checkBox4 = new Button(composite1, SWT.CHECK);
checkBox5 = new Button(composite1, SWT.CHECK);
checkBox6 = new Button(composite1, SWT.CHECK);
checkBox7 = new Button(composite1, SWT.CHECK);
composite1.setLayout(gridLayout13);
composite1.setLayoutData(gridData14);
gridLayout13.numColumns = 4;
gridLayout13.makeColumnsEqualWidth = false;
gridData14.heightHint = 50;
gridData14.grabExcessHorizontalSpace = false;
gridData14.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
gridData14.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
checkBox.setText("Sausage");
checkBox.setLayoutData(gridData15);
gridData15.widthHint = 80;
checkBox1.setText("Pepperoni");
checkBox1.setLayoutData(gridData16);
gridData16.widthHint = 90;
checkBox2.setText("Mushrooms");
checkBox2.setLayoutData(gridData17);
gridData17.widthHint = 110;
checkBox3.setText("Green Peppers");
checkBox3.setLayoutData(gridData18);
gridData18.widthHint = 120;
checkBox4.setText("Anchovies");
checkBox4.setLayoutData(gridData19);
gridData19.widthHint = 90;
checkBox5.setText("Onions");
checkBox5.setLayoutData(gridData20);
gridData20.widthHint = 90;
checkBox6.setText("Bacon");
checkBox6.setLayoutData(gridData21);
gridData21.widthHint = 80;
checkBox7.setText("Extra Cheese");
checkBox7.setLayoutData(gridData22);
gridData22.widthHint = 110;
}
public static void main(String[] args)
{

/*
* Before this is run, be sure to set up the following in the launch
* configuration (Arguments->VM Arguments) for the correct SWT library path.
* The following is a windows example:
* -Djava.library.path=" installation_directory\plugins\org.eclipse.swt.win32_3.0.0\o s\win32\x86 "
*/
org.eclipse.swt.widgets.Display display = org.eclipse.swt.widgets.Display
.getDefault();
VisualEditorTest thisClass = new VisualEditorTest();
thisClass.createSShell();
thisClass.sShell.open();
while (!thisClass.sShell.isDisposed())
{
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}

/**
* This method initializes sShell
*/
private void createSShell()
{
sShell = new org.eclipse.swt.widgets.Shell();
GridLayout gridLayout1 = new GridLayout();
GridData gridData2 = new org.eclipse.swt.layout.GridData();
GridData gridData3 = new GridData();
GridData gridData4 = new GridData();
GridData gridData5 = new org.eclipse.swt.layout.GridData();
GridData gridData6 = new org.eclipse.swt.layout.GridData();
GridData gridData12 = new org.eclipse.swt.layout.GridData();
label = new Label(sShell, SWT.NONE);
text = new Text(sShell, SWT.NONE);
label1 = new Label(sShell, SWT.NONE);
text1 = new Text(sShell, SWT.MULTI | SWT.BORDER);
label2 = new Label(sShell, SWT.NONE);
createComposite();
label3 = new Label(sShell, SWT.NONE);
createComposite1();
text1.setSize(200, 200);
sShell.setSize(new org.eclipse.swt.graphics.Point(600,400));
sShell.setText("Created With Visual Editor");
sShell.setLayout(gridLayout1);
label.setText("Name:");
label.setLayoutData(gridData3);
label.setFont(new org.eclipse.swt.graphics.Font(
org.eclipse.swt.widgets.Display.getDefault(), "Sans", 10,
org.eclipse.swt.SWT.BOLD));
gridLayout1.numColumns = 2;
gridLayout1.makeColumnsEqualWidth = false;
gridData2.grabExcessHorizontalSpace = true;
gridData2.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
gridData2.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
text.setLayoutData(gridData2);
text.setFont(new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Displa y.getDefault(), "Sans", 10, org.eclipse.swt.SWT.BOLD));
label1.setText("Address:");
label1.setLayoutData(gridData4);
label1.setFont(new org.eclipse.swt.graphics.Font(
org.eclipse.swt.widgets.Display.getDefault(), "Sans", 10,
org.eclipse.swt.SWT.BOLD));
gridData3.horizontalAlignment = org.eclipse.swt.layout.GridData.END;
gridData4.horizontalAlignment = org.eclipse.swt.layout.GridData.END;
gridData4.verticalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;
gridData5.horizontalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;
gridData5.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
gridData5.verticalSpan = 1;
gridData5.grabExcessVerticalSpace = false;
gridData5.heightHint = 50;
gridData5.grabExcessHorizontalSpace = false;
gridData5.widthHint = 200;
text1.setLayoutData(gridData5);
label2.setText("Crust:");
label2.setLayoutData(gridData6);
label2.setFont(new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Displa y.getDefault(), "Sans", 10, org.eclipse.swt.SWT.BOLD));
gridData6.horizontalAlignment = org.eclipse.swt.layout.GridData.END;
gridData6.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
label3.setText("Toppings:");
label3.setLayoutData(gridData12);
label3.setFont(new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Displa y.getDefault(), "Sans", 10, org.eclipse.swt.SWT.BOLD));
gridData12.horizontalAlignment = org.eclipse.swt.layout.GridData.END;
gridData12.verticalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;
}


Thanks for any help,
Ray.
Re: SWT Application Does Not Display Correctly Until Resized. [message #64021 is a reply to message #63995] Sun, 03 October 2004 08:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eraserman.nospam.gmail.com

Replying to myself here, but I just had a chance to test the
code under Windows 2000, and it works fine there. It seems to be
a Linux/GTK issue.

Ray.
Re: SWT Application Does Not Display Correctly Until Resized. [message #64231 is a reply to message #64021] Mon, 04 October 2004 11:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Just for laughs, move

sShell.setSize(new org.eclipse.swt.graphics.Point(600,400));

to the very last line in createSShell().

I'm thinking that we are missing a layout do to the size was changed
before we set griddata on anything.

Ray Davis wrote:
> Replying to myself here, but I just had a chance to test the
> code under Windows 2000, and it works fine there. It seems to be
> a Linux/GTK issue.
>
> Ray.

--
Thanks,
Rich Kulp
Re: SWT Application Does Not Display Correctly Until Resized. [message #64322 is a reply to message #64231] Mon, 04 October 2004 11:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

What build of VE do you have?

Do Help->About Eclipse->Feature Details button. Select org.eclipse.ve,
then at the bottom of the dialog it will say "build id: ..." What build
id is listed?

The reason I ask is in the past we had problems with placing the
setSize, but we just tested it and seems to work correctly.

Also, there was a

text1.setSize(200, 200);

in createSShell which shouldn't of been there. When you switched to Grid
layout, we should of removed it.

--
Thanks,
Rich Kulp
Re: SWT Application Does Not Display Correctly Until Resized. [message #64453 is a reply to message #64322] Mon, 04 October 2004 09:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eraserman.nospam.gmail.com

On Mon, 04 Oct 2004 11:48:59 -0400, Rich Kulp wrote:

> What build of VE do you have?
>
> Do Help->About Eclipse->Feature Details button. Select org.eclipse.ve,
> then at the bottom of the dialog it will say "build id: ..." What build
> id is listed?
>
> The reason I ask is in the past we had problems with placing the
> setSize, but we just tested it and seems to work correctly.
>
> Also, there was a
>
> text1.setSize(200, 200);
>
> in createSShell which shouldn't of been there. When you switched to Grid
> layout, we should of removed it.

Rich,

Here is the Visual Editor information displayed in the
feature details dialog:

Visual Editor

Version: 1.0.1
Build id: 200409191449

Ray
Re: SWT Application Does Not Display Correctly Until Resized. [message #64475 is a reply to message #64453] Mon, 04 October 2004 16:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

That's the released version.

That shouldn't of happened. What exact steps, from creating the class
on, did you do?


--
Thanks,
Rich Kulp
Re: SWT Application Does Not Display Correctly Until Resized. [message #64497 is a reply to message #64231] Mon, 04 October 2004 10:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eraserman.nospam.gmail.com

On Mon, 04 Oct 2004 11:15:41 -0400, Rich Kulp wrote:

> Just for laughs, move
>
> sShell.setSize(new org.eclipse.swt.graphics.Point(600,400));
>
> to the very last line in createSShell().
>
> I'm thinking that we are missing a layout do to the size was changed
> before we set griddata on anything.
>
> Ray Davis wrote:
>> Replying to myself here, but I just had a chance to test the
>> code under Windows 2000, and it works fine there. It seems to be
>> a Linux/GTK issue.
>>
>> Ray.

Rich,

Moving sShell.setSize(new org.eclipse.swt.graphics.Point(600,400));
to be the very last line in createSShell() took care of the problem.

I'm not sure why the problem is there in the first place but this is
a fairly easy workaround.

Ray
Re: SWT Application Does Not Display Correctly Until Resized. [message #65114 is a reply to message #64475] Tue, 05 October 2004 13:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eraserman.nospam.gmail.com

On Mon, 04 Oct 2004 16:01:25 -0400, Rich Kulp wrote:

> That's the released version.
>
> That shouldn't of happened. What exact steps, from creating the class
> on, did you do?

I can't remember the exact steps, but it was somewhat like this:

I clicked on the class icon in the toolbar (green circle with a "C+"
inside), clicked on "Visual Class", filled in the source folder,
package and class name, left the default SWT application style and
clicked on "finish".

If I remember correctly, I then changed the layout to GridLayout (BTW,
I might have set the size of the text component myself, through the
properties view, I was experimenting with the different options).

I then set the number of columns for the layout to be two, and
started adding components from the palette. A label, a text field,
another label, a multi-line text field, another label, a composite,
changed the layout for the composite to be GridLayout, set the number of
columns for the composite's layout to be 3, then added some radio buttons
to that composite, another label, another composite, again set the layout
for the new composite to be GridLayout, and set the number of columns to
be 4, added the check buttons to the second composite.

I don't think I did anything out of the ordinary.

In any case, I've been trying the Visual Editor in my spare time,
I'm not working on any super important documents or anything. In my day
job, I'm stuck with an HTML user interface for a J2EE application.

Ray
Re: SWT Application Does Not Display Correctly Until Resized. [message #65241 is a reply to message #65114] Wed, 06 October 2004 14:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Thanks we now see what's going on. I've opened two defects to fix this,
but the workaround for now is to move the setSize to the end. From that
point on everything should work fine.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=75725

https://bugs.eclipse.org/bugs/show_bug.cgi?id=75726

--
Thanks,
Rich Kulp
Re: SWT Application Does Not Display Correctly Until Resized. [message #65349 is a reply to message #65241] Thu, 07 October 2004 07:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eraserman.nospam.gmail.com

Rich Kulp wrote:
> Thanks we now see what's going on. I've opened two defects to fix this,
> but the workaround for now is to move the setSize to the end. From that
> point on everything should work fine.
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=75725
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=75726
>

I saw the bug reports, and I have a question, the bug reports say that
setText() and setSize() must be reversed. According to the workaround,
setSize() must be last in the createSShell() method. Looking at my
code, some components are added right after setText(), it looks like if
setText() and setSize() are reversed, then those components would be
added right after setSize().

This might not fix the problem since the components would still be
added after setSize(). I think Visual Editor
needs to add the setSize() as the last line in createSShell() regardless
of when the user sets the size of the shell.

Let me know if my assumption is correct.

Ray
Re: SWT Application Does Not Display Correctly Until Resized. [message #65370 is a reply to message #65349] Thu, 07 October 2004 09:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mendelgili.netscape.net

The "workaround" is to place the setSize() at the end of the createMethod() (last statement).
Top down, VE will keep the setSize() at the end of the method even if you drop new components.

The question become a bit more tricky with this defect; what to do when the code's statement order is wrong.

Assume the following bad order (A should come before C):

C
A

Where do you inser B? before C or after A....
Re: SWT Application Does Not Display Correctly Until Resized. [message #65472 is a reply to message #65370] Thu, 07 October 2004 12:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eraserman.nospam.gmail.com

Gili Mendel wrote:
>
> The "workaround" is to place the setSize() at the end of the
> createMethod() (last statement).
> Top down, VE will keep the setSize() at the end of the method even if
> you drop new components.
<snip>

That's what I thought, but I don't think this is stated explicitly in
the bug report, it only says that setSize() must come after setText().

(https://bugs.eclipse.org/bugs/show_bug.cgi?id=75725)

Ray
Re: SWT Application Does Not Display Correctly Until Resized. [message #65510 is a reply to message #65472] Thu, 07 October 2004 13:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

That bug had only to do with our template for creating the class. We
needed to change it so it created the class correctly. The code was
already correct when up in the ve for handling setSize() if setSize()
was last. The other bug listed was for handling when setSize() was not
in the correct place.


--
Thanks,
Rich Kulp
Re: SWT Application Does Not Display Correctly Until Resized. [message #65742 is a reply to message #65510] Fri, 08 October 2004 15:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Hey guys,

I seem to remember that Win32 sends a bogus resize event on Shell.show().
That event causes the layout and explains the different behavior on
non-windows platforms.

"Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> wrote in message
news:ck3v3e$kgd$1@eclipse.org...
> That bug had only to do with our template for creating the class. We
> needed to change it so it created the class correctly. The code was
> already correct when up in the ve for handling setSize() if setSize()
> was last. The other bug listed was for handling when setSize() was not
> in the correct place.
>
>
> --
> Thanks,
> Rich Kulp
Re: SWT Application Does Not Display Correctly Until Resized. [message #65984 is a reply to message #65742] Mon, 11 October 2004 11:41 Go to previous messageGo to next message
Eclipse UserFriend
Randy Hudson wrote:
> Hey guys,
>
> I seem to remember that Win32 sends a bogus resize event on Shell.show().
> That event causes the layout and explains the different behavior on
> non-windows platforms.

Thanks Randy. In your opinion, should we file a PR against Platform/SWT
with the suggestion that SWT do the same thing across platforms here or
does this fall into SWT's "don't count on event ordering" mantra?


Thanks,

Dave

--
Dave Orme
Eclipse Visual Editor Project Lead
Advanced Systems Concepts' Chief Architect
http://www.swtworkbench.com http://essentialdata.sf.net
Re: SWT Application Does Not Display Correctly Until Resized. [message #67160 is a reply to message #65984] Fri, 15 October 2004 14:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

So I was thinking of this really old bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=4409

Which was finally fixed in 3.0, but the fix introduced a regression.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=71975

It sounds like you are seeing the regression and not the original
inconsistency.

"David Orme" <daveo@asc-iseries.com> wrote in message
news:cke99d$1jj$1@eclipse.org...
> Randy Hudson wrote:
> > Hey guys,
> >
> > I seem to remember that Win32 sends a bogus resize event on
Shell.show().
> > That event causes the layout and explains the different behavior on
> > non-windows platforms.
>
> Thanks Randy. In your opinion, should we file a PR against Platform/SWT
> with the suggestion that SWT do the same thing across platforms here or
> does this fall into SWT's "don't count on event ordering" mantra?
>
>
> Thanks,
>
> Dave
>
> --
> Dave Orme
> Eclipse Visual Editor Project Lead
> Advanced Systems Concepts' Chief Architect
> http://www.swtworkbench.com http://essentialdata.sf.net
Re: SWT Application Does Not Display Correctly Until Resized. [message #67170 is a reply to message #67160] Fri, 15 October 2004 14:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

According to the description of the fix in bug 71975, the original test case
which started this thread should fail equally on all platforms. Can anyone
verify this?

"Randy Hudson" <none@us.ibm.com> wrote in message
news:ckp4ao$i9a$1@eclipse.org...
> So I was thinking of this really old bug:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=4409
>
> Which was finally fixed in 3.0, but the fix introduced a regression.
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=71975
>
> It sounds like you are seeing the regression and not the original
> inconsistency.
>
> "David Orme" <daveo@asc-iseries.com> wrote in message
> news:cke99d$1jj$1@eclipse.org...
> > Randy Hudson wrote:
> > > Hey guys,
> > >
> > > I seem to remember that Win32 sends a bogus resize event on
> Shell.show().
> > > That event causes the layout and explains the different behavior on
> > > non-windows platforms.
> >
> > Thanks Randy. In your opinion, should we file a PR against Platform/SWT
> > with the suggestion that SWT do the same thing across platforms here or
> > does this fall into SWT's "don't count on event ordering" mantra?
> >
> >
> > Thanks,
> >
> > Dave
> >
> > --
> > Dave Orme
> > Eclipse Visual Editor Project Lead
> > Advanced Systems Concepts' Chief Architect
> > http://www.swtworkbench.com http://essentialdata.sf.net
>
>
Re: SWT Application Does Not Display Correctly Until Resized. [message #67180 is a reply to message #67160] Fri, 15 October 2004 14:29 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> Which was finally fixed in 3.0, but the fix introduced a regression.
Actually that's wrong. It was *reported* against 3.0, looks like it was
fixed in the 3.1 stream, so you are seeing the original bug.

> https://bugs.eclipse.org/bugs/show_bug.cgi?id=71975
Re: SWT Application Does Not Display Correctly Until Resized. [message #600509 is a reply to message #63995] Sun, 03 October 2004 08:25 Go to previous message
Eclipse UserFriend
Originally posted by: eraserman.nospam.gmail.com

Replying to myself here, but I just had a chance to test the
code under Windows 2000, and it works fine there. It seems to be
a Linux/GTK issue.

Ray.
Re: SWT Application Does Not Display Correctly Until Resized. [message #600603 is a reply to message #64021] Mon, 04 October 2004 11:15 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Just for laughs, move

sShell.setSize(new org.eclipse.swt.graphics.Point(600,400));

to the very last line in createSShell().

I'm thinking that we are missing a layout do to the size was changed
before we set griddata on anything.

Ray Davis wrote:
> Replying to myself here, but I just had a chance to test the
> code under Windows 2000, and it works fine there. It seems to be
> a Linux/GTK issue.
>
> Ray.

--
Thanks,
Rich Kulp
Re: SWT Application Does Not Display Correctly Until Resized. [message #600641 is a reply to message #64231] Mon, 04 October 2004 11:48 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

What build of VE do you have?

Do Help->About Eclipse->Feature Details button. Select org.eclipse.ve,
then at the bottom of the dialog it will say "build id: ..." What build
id is listed?

The reason I ask is in the past we had problems with placing the
setSize, but we just tested it and seems to work correctly.

Also, there was a

text1.setSize(200, 200);

in createSShell which shouldn't of been there. When you switched to Grid
layout, we should of removed it.

--
Thanks,
Rich Kulp
Re: SWT Application Does Not Display Correctly Until Resized. [message #600687 is a reply to message #64322] Mon, 04 October 2004 09:56 Go to previous message
Eclipse UserFriend
Originally posted by: eraserman.nospam.gmail.com

On Mon, 04 Oct 2004 11:48:59 -0400, Rich Kulp wrote:

> What build of VE do you have?
>
> Do Help->About Eclipse->Feature Details button. Select org.eclipse.ve,
> then at the bottom of the dialog it will say "build id: ..." What build
> id is listed?
>
> The reason I ask is in the past we had problems with placing the
> setSize, but we just tested it and seems to work correctly.
>
> Also, there was a
>
> text1.setSize(200, 200);
>
> in createSShell which shouldn't of been there. When you switched to Grid
> layout, we should of removed it.

Rich,

Here is the Visual Editor information displayed in the
feature details dialog:

Visual Editor

Version: 1.0.1
Build id: 200409191449

Ray
Re: SWT Application Does Not Display Correctly Until Resized. [message #600695 is a reply to message #64453] Mon, 04 October 2004 16:01 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

That's the released version.

That shouldn't of happened. What exact steps, from creating the class
on, did you do?


--
Thanks,
Rich Kulp
Re: SWT Application Does Not Display Correctly Until Resized. [message #600704 is a reply to message #64231] Mon, 04 October 2004 10:04 Go to previous message
Eclipse UserFriend
Originally posted by: eraserman.nospam.gmail.com

On Mon, 04 Oct 2004 11:15:41 -0400, Rich Kulp wrote:

> Just for laughs, move
>
> sShell.setSize(new org.eclipse.swt.graphics.Point(600,400));
>
> to the very last line in createSShell().
>
> I'm thinking that we are missing a layout do to the size was changed
> before we set griddata on anything.
>
> Ray Davis wrote:
>> Replying to myself here, but I just had a chance to test the
>> code under Windows 2000, and it works fine there. It seems to be
>> a Linux/GTK issue.
>>
>> Ray.

Rich,

Moving sShell.setSize(new org.eclipse.swt.graphics.Point(600,400));
to be the very last line in createSShell() took care of the problem.

I'm not sure why the problem is there in the first place but this is
a fairly easy workaround.

Ray
Re: SWT Application Does Not Display Correctly Until Resized. [message #600910 is a reply to message #64475] Tue, 05 October 2004 13:23 Go to previous message
Eclipse UserFriend
Originally posted by: eraserman.nospam.gmail.com

On Mon, 04 Oct 2004 16:01:25 -0400, Rich Kulp wrote:

> That's the released version.
>
> That shouldn't of happened. What exact steps, from creating the class
> on, did you do?

I can't remember the exact steps, but it was somewhat like this:

I clicked on the class icon in the toolbar (green circle with a "C+"
inside), clicked on "Visual Class", filled in the source folder,
package and class name, left the default SWT application style and
clicked on "finish".

If I remember correctly, I then changed the layout to GridLayout (BTW,
I might have set the size of the text component myself, through the
properties view, I was experimenting with the different options).

I then set the number of columns for the layout to be two, and
started adding components from the palette. A label, a text field,
another label, a multi-line text field, another label, a composite,
changed the layout for the composite to be GridLayout, set the number of
columns for the composite's layout to be 3, then added some radio buttons
to that composite, another label, another composite, again set the layout
for the new composite to be GridLayout, and set the number of columns to
be 4, added the check buttons to the second composite.

I don't think I did anything out of the ordinary.

In any case, I've been trying the Visual Editor in my spare time,
I'm not working on any super important documents or anything. In my day
job, I'm stuck with an HTML user interface for a J2EE application.

Ray
Re: SWT Application Does Not Display Correctly Until Resized. [message #600954 is a reply to message #65114] Wed, 06 October 2004 14:48 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Thanks we now see what's going on. I've opened two defects to fix this,
but the workaround for now is to move the setSize to the end. From that
point on everything should work fine.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=75725

https://bugs.eclipse.org/bugs/show_bug.cgi?id=75726

--
Thanks,
Rich Kulp
Re: SWT Application Does Not Display Correctly Until Resized. [message #600985 is a reply to message #65241] Thu, 07 October 2004 07:22 Go to previous message
Eclipse UserFriend
Originally posted by: eraserman.nospam.gmail.com

Rich Kulp wrote:
> Thanks we now see what's going on. I've opened two defects to fix this,
> but the workaround for now is to move the setSize to the end. From that
> point on everything should work fine.
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=75725
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=75726
>

I saw the bug reports, and I have a question, the bug reports say that
setText() and setSize() must be reversed. According to the workaround,
setSize() must be last in the createSShell() method. Looking at my
code, some components are added right after setText(), it looks like if
setText() and setSize() are reversed, then those components would be
added right after setSize().

This might not fix the problem since the components would still be
added after setSize(). I think Visual Editor
needs to add the setSize() as the last line in createSShell() regardless
of when the user sets the size of the shell.

Let me know if my assumption is correct.

Ray
Re: SWT Application Does Not Display Correctly Until Resized. [message #600990 is a reply to message #65349] Thu, 07 October 2004 09:14 Go to previous message
Eclipse UserFriend
The "workaround" is to place the setSize() at the end of the createMethod() (last statement).
Top down, VE will keep the setSize() at the end of the method even if you drop new components.

The question become a bit more tricky with this defect; what to do when the code's statement order is wrong.

Assume the following bad order (A should come before C):

C
A

Where do you inser B? before C or after A....
Re: SWT Application Does Not Display Correctly Until Resized. [message #601018 is a reply to message #65370] Thu, 07 October 2004 12:54 Go to previous message
Eclipse UserFriend
Originally posted by: eraserman.nospam.gmail.com

Gili Mendel wrote:
>
> The "workaround" is to place the setSize() at the end of the
> createMethod() (last statement).
> Top down, VE will keep the setSize() at the end of the method even if
> you drop new components.
<snip>

That's what I thought, but I don't think this is stated explicitly in
the bug report, it only says that setSize() must come after setText().

(https://bugs.eclipse.org/bugs/show_bug.cgi?id=75725)

Ray
Re: SWT Application Does Not Display Correctly Until Resized. [message #601031 is a reply to message #65472] Thu, 07 October 2004 13:46 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

That bug had only to do with our template for creating the class. We
needed to change it so it created the class correctly. The code was
already correct when up in the ve for handling setSize() if setSize()
was last. The other bug listed was for handling when setSize() was not
in the correct place.


--
Thanks,
Rich Kulp
Re: SWT Application Does Not Display Correctly Until Resized. [message #601086 is a reply to message #65510] Fri, 08 October 2004 15:58 Go to previous message
Eclipse UserFriend
Hey guys,

I seem to remember that Win32 sends a bogus resize event on Shell.show().
That event causes the layout and explains the different behavior on
non-windows platforms.

"Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> wrote in message
news:ck3v3e$kgd$1@eclipse.org...
> That bug had only to do with our template for creating the class. We
> needed to change it so it created the class correctly. The code was
> already correct when up in the ve for handling setSize() if setSize()
> was last. The other bug listed was for handling when setSize() was not
> in the correct place.
>
>
> --
> Thanks,
> Rich Kulp
Re: SWT Application Does Not Display Correctly Until Resized. [message #601201 is a reply to message #65742] Mon, 11 October 2004 11:41 Go to previous message
Eclipse UserFriend
Randy Hudson wrote:
> Hey guys,
>
> I seem to remember that Win32 sends a bogus resize event on Shell.show().
> That event causes the layout and explains the different behavior on
> non-windows platforms.

Thanks Randy. In your opinion, should we file a PR against Platform/SWT
with the suggestion that SWT do the same thing across platforms here or
does this fall into SWT's "don't count on event ordering" mantra?


Thanks,

Dave

--
Dave Orme
Eclipse Visual Editor Project Lead
Advanced Systems Concepts' Chief Architect
http://www.swtworkbench.com http://essentialdata.sf.net
Re: SWT Application Does Not Display Correctly Until Resized. [message #601673 is a reply to message #65984] Fri, 15 October 2004 14:24 Go to previous message
Eclipse UserFriend
So I was thinking of this really old bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=4409

Which was finally fixed in 3.0, but the fix introduced a regression.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=71975

It sounds like you are seeing the regression and not the original
inconsistency.

"David Orme" <daveo@asc-iseries.com> wrote in message
news:cke99d$1jj$1@eclipse.org...
> Randy Hudson wrote:
> > Hey guys,
> >
> > I seem to remember that Win32 sends a bogus resize event on
Shell.show().
> > That event causes the layout and explains the different behavior on
> > non-windows platforms.
>
> Thanks Randy. In your opinion, should we file a PR against Platform/SWT
> with the suggestion that SWT do the same thing across platforms here or
> does this fall into SWT's "don't count on event ordering" mantra?
>
>
> Thanks,
>
> Dave
>
> --
> Dave Orme
> Eclipse Visual Editor Project Lead
> Advanced Systems Concepts' Chief Architect
> http://www.swtworkbench.com http://essentialdata.sf.net
Re: SWT Application Does Not Display Correctly Until Resized. [message #601679 is a reply to message #67160] Fri, 15 October 2004 14:27 Go to previous message
Eclipse UserFriend
According to the description of the fix in bug 71975, the original test case
which started this thread should fail equally on all platforms. Can anyone
verify this?

"Randy Hudson" <none@us.ibm.com> wrote in message
news:ckp4ao$i9a$1@eclipse.org...
> So I was thinking of this really old bug:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=4409
>
> Which was finally fixed in 3.0, but the fix introduced a regression.
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=71975
>
> It sounds like you are seeing the regression and not the original
> inconsistency.
>
> "David Orme" <daveo@asc-iseries.com> wrote in message
> news:cke99d$1jj$1@eclipse.org...
> > Randy Hudson wrote:
> > > Hey guys,
> > >
> > > I seem to remember that Win32 sends a bogus resize event on
> Shell.show().
> > > That event causes the layout and explains the different behavior on
> > > non-windows platforms.
> >
> > Thanks Randy. In your opinion, should we file a PR against Platform/SWT
> > with the suggestion that SWT do the same thing across platforms here or
> > does this fall into SWT's "don't count on event ordering" mantra?
> >
> >
> > Thanks,
> >
> > Dave
> >
> > --
> > Dave Orme
> > Eclipse Visual Editor Project Lead
> > Advanced Systems Concepts' Chief Architect
> > http://www.swtworkbench.com http://essentialdata.sf.net
>
>
Re: SWT Application Does Not Display Correctly Until Resized. [message #601683 is a reply to message #67160] Fri, 15 October 2004 14:29 Go to previous message
Eclipse UserFriend
> Which was finally fixed in 3.0, but the fix introduced a regression.
Actually that's wrong. It was *reported* against 3.0, looks like it was
fixed in the 3.1 stream, so you are seeing the original bug.

> https://bugs.eclipse.org/bugs/show_bug.cgi?id=71975
Previous Topic:java.lang.NoSuchMethodException in ve
Next Topic:How I can implement anoth Visual Editor?
Goto Forum:
  


Current Time: Thu May 08 18:07:02 EDT 2025

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

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

Back to the top