Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Continue the control resize problem, Can anyone tell me that whether or not the nested composite hav
Continue the control resize problem, Can anyone tell me that whether or not the nested composite hav [message #445319] Tue, 02 November 2004 02:39 Go to next message
Eclipse UserFriend
Originally posted by: liankun_mail.21cn.com

This is a multi-part message in MIME format.

------=_NextPart_000_0024_01C4C0C8.2F43C820
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

OS: Win2000 .

Can anyone tell me that whether or not the nested composite have the =
number limit ?
and how to avoid this problem ?

SOURCE CODE :


/*
* Created on 2004-11-2
*
*/
package org.jeff.swt;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

/**
* @author JeffLian.
*
*/
public class T10 {

public static void main(String[] args) {
//create shell
final Display display =3D new Display();
Shell shell =3D new Shell(display);
shell.setLayout(new FillLayout());
=20
//create content=20
Composite content =3D new Composite(shell, SWT.NONE);
content.setLayout(new FillLayout());
=20
/**---------------------------------------------
* add child composite=20
* When the variable "len" less than 11, the Button will show =
normal=20
*=20
* Can anyone tell me that whether or not the nested composite =
have the number limit ?
* and how to avoid this problem ?
* =20
---------------------------------------------*/
int len =3D 11;
Composite kk =3D new Composite(content, SWT.BORDER);
kk.setLayout(new FillLayout());
for(int i=3D0; i< len ;i++ ){
kk =3D new Composite(kk, SWT.BORDER);
kk.setLayout(new FillLayout());
}
=20
new Button(kk,SWT.PUSH).setText("BUTTON");
=20
=20
shell.setBounds(20, 30, 500, 500);
shell.open();
while (!shell.isDisposed()){
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
=20
}
}

------=_NextPart_000_0024_01C4C0C8.2F43C820
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3D"Courier New" size=3D2>OS: Win2000 .</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>Can anyone tell me that whether =
or not the=20
nested composite have the number limit ?<BR>and how to avoid this =
problem=20
?<BR></FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>SOURCE CODE :</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2><FONT =
face=3D=CB=CE=CC=E5></FONT>&nbsp;</DIV></FONT>
<DIV><FONT face=3D"Courier New" size=3D2>/*<BR>&nbsp;* Created on=20
2004-11-2<BR>&nbsp;*<BR>&nbsp;*/<BR>package org.jeff.swt;</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>import =
org.eclipse.swt.SWT;<BR>import=20
org.eclipse.swt.layout.*;<BR>import =
org.eclipse.swt.widgets.*;</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>/**<BR>&nbsp;* @author=20
JeffLian.<BR>&nbsp;*<BR>&nbsp;*/<BR>public class T10 {</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>&nbsp;&nbsp;&nbsp; public =
static void=20
main(String[] args) {<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; =
//create=20
shell<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; final Display =
display =3D new=20
Display();<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Shell shell =3D =
new=20
Shell(display);<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
shell.setLayout(new =
FillLayout());<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; //create content=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Composite content =3D new =

Composite(shell, =
SWT.NONE);<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
content.setLayout(new=20
FillLayout());<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
/**---------------------------------------------<BR>&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;=20
* add child composite =
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; *=20
When the variable "len" less than 11, the Button will show normal=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; *=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; * Can anyone tell =
me that=20
whether or not the nested composite have the number limit=20
?<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; * and how to avoid =
this=20
problem ?<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; *&nbsp;=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;=20
---------------------------------------------*/<BR>&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;=20
int len =3D 11;<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Composite =
kk =3D new=20
Composite(content, =
SWT.BORDER);<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
kk.setLayout(new =
FillLayout());<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
for(int i=3D0; i&lt; len ;i++=20
){<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
kk =3D=20
new Composite(kk,=20
SWT.BORDER);<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;=20
kk.setLayout(new =
FillLayout());<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
}<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; new=20
Button(kk,SWT.PUSH).setText("BUTTON");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; shell.setBounds(20, 30, =
500,=20
500);<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
shell.open();<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; while=20
(!shell.isDisposed()){<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;=20
if (!display.readAndDispatch())=20
display.sleep();<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
}<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
display.dispose();<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;=20
}<BR>}<BR></FONT></DIV></BODY></HTML>

------=_NextPart_000_0024_01C4C0C8.2F43C820--
Re: Continue the control resize problem, Can anyone tell me that whether or not the nested composite [message #445331 is a reply to message #445319] Tue, 02 November 2004 15:41 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_0070_01C4C0C8.81B065F0
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

On XP, WORKSFORME.
"JeffLian" <liankun_mail@21cn.com> wrote in message =
news:cm6s0s$qoc$1@eclipse.org...
OS: Win2000 .

Can anyone tell me that whether or not the nested composite have the =
number limit ?
and how to avoid this problem ?

SOURCE CODE :


/*
* Created on 2004-11-2
*
*/
package org.jeff.swt;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

/**
* @author JeffLian.
*
*/
public class T10 {

public static void main(String[] args) {
//create shell
final Display display =3D new Display();
Shell shell =3D new Shell(display);
shell.setLayout(new FillLayout());
=20
//create content=20
Composite content =3D new Composite(shell, SWT.NONE);
content.setLayout(new FillLayout());
=20
/**---------------------------------------------
* add child composite=20
* When the variable "len" less than 11, the Button will show =
normal=20
*=20
* Can anyone tell me that whether or not the nested composite =
have the number limit ?
* and how to avoid this problem ?
* =20
---------------------------------------------*/
int len =3D 11;
Composite kk =3D new Composite(content, SWT.BORDER);
kk.setLayout(new FillLayout());
for(int i=3D0; i< len ;i++ ){
kk =3D new Composite(kk, SWT.BORDER);
kk.setLayout(new FillLayout());
}
=20
new Button(kk,SWT.PUSH).setText("BUTTON");
=20
=20
shell.setBounds(20, 30, 500, 500);
shell.open();
while (!shell.isDisposed()){
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
=20
}
}

------=_NextPart_000_0070_01C4C0C8.81B065F0
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>On XP, WORKSFORME.</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"JeffLian" &lt;<A=20
href=3D"mailto:liankun_mail@21cn.com">liankun_mail@21cn.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:cm6s0s$qoc$1@eclipse.org">news:cm6s0s$qoc$1@eclipse.org</A>.=
...</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>OS: Win2000 .</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>Can anyone tell me that =
whether or not=20
the nested composite have the number limit ?<BR>and how to avoid this =
problem=20
?<BR></FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>SOURCE CODE :</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2><FONT =
face=3D=CB=CE=CC=E5></FONT>&nbsp;</DIV></FONT>
<DIV><FONT face=3D"Courier New" size=3D2>/*<BR>&nbsp;* Created on=20
2004-11-2<BR>&nbsp;*<BR>&nbsp;*/<BR>package org.jeff.swt;</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>import =
org.eclipse.swt.SWT;<BR>import=20
org.eclipse.swt.layout.*;<BR>import =
org.eclipse.swt.widgets.*;</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>/**<BR>&nbsp;* @author=20
JeffLian.<BR>&nbsp;*<BR>&nbsp;*/<BR>public class T10 {</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>&nbsp;&nbsp;&nbsp; public =
static void=20
main(String[] args) {<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; =
//create=20
shell<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; final Display =
display =3D=20
new Display();<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Shell =
shell =3D new=20
Shell(display);<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
shell.setLayout(new=20
FillLayout());<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; //create content=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Composite content =3D =
new=20
Composite(shell, =
SWT.NONE);<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
content.setLayout(new=20
FillLayout());<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
=
/**---------------------------------------------<BR>&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;=20
* add child composite =
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; *=20
When the variable "len" less than 11, the Button will show normal=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; *=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; * Can anyone tell =
me that=20
whether or not the nested composite have the number limit=20
?<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; * and how to =
avoid this=20
problem ?<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; *&nbsp;=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;=20
=
---------------------------------------------*/<BR>&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;=20
int len =3D 11;<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; =
Composite kk =3D new=20
Composite(content, =
SWT.BORDER);<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
kk.setLayout(new =
FillLayout());<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
for(int i=3D0; i&lt; len ;i++=20
=
){<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
kk =3D=20
new Composite(kk,=20
=
SWT.BORDER);<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;=20
kk.setLayout(new =
FillLayout());<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
}<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; new=20
=
Button(kk,SWT.PUSH).setText("BUTTON");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; shell.setBounds(20, 30, =
500,=20
500);<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
shell.open();<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; while=20
=
(!shell.isDisposed()){<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;=20
if (!display.readAndDispatch())=20
display.sleep();<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
}<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
display.dispose();<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;=20
}<BR>}<BR></FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0070_01C4C0C8.81B065F0--
Re: Continue the control resize problem, Can anyone tell me that whether or not the nested composite [message #445416 is a reply to message #445331] Fri, 05 November 2004 12:05 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
I get the "No more handles" error when len = 45 on Windows XP.

"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:cm89qo$egp$1@eclipse.org...

On XP, WORKSFORME.
Previous Topic:View multipage tiffs in SWT?
Next Topic:ScrollBar problem
Goto Forum:
  


Current Time: Tue Oct 27 22:18:51 GMT 2020

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

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

Back to the top