Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Blank space after widget is not visible.
Blank space after widget is not visible. [message #435287] Mon, 26 April 2004 18:38 Go to next message
Eclipse UserFriend
Originally posted by: meerab.yahoo.com

Hello,

I am using GridLayout to display a form. The form makes some widget
controls "visible" and "invisible" based on user input.

I am observing that form is showing blank space for the controls that are
not visible. I am not able to get rid of the empty space. Has anyone faced
this issue? How to get rid of the blank space when the control is no
longer visible?


Pseudo code is..

// Add bannana
Text bannana = new Text(parent, SWT.Border);
bannana.setLayoutData( new GridData());

// Add mango
Text mango = new Text(parent, SWT.Border);
mango.setLayoutData( new GridData());


//... Some where down in the code..

if(userchoice == magno) {
bannana.setVisible(false);
mango.setVisible(true);
parent.pack(true);
}else {
bannana.setVisible(true);
mango.setVisible(false);
parent.pack(true);
}
** I see a blank link in the form display showing empty space for the
widget that has visibility "false" ***

Thanks for your help!!

-Meera
Re: Blank space after widget is not visible. [message #439367 is a reply to message #435287] Mon, 12 July 2004 12:51 Go to previous messageGo to next message
Kneubuehl Thomas is currently offline Kneubuehl ThomasFriend
Messages: 7
Registered: July 2009
Junior Member
Meera wrote:
> Hello,
>
> I am using GridLayout to display a form. The form makes some widget
> controls "visible" and "invisible" based on user input.
>
> I am observing that form is showing blank space for the controls that are
> not visible. I am not able to get rid of the empty space. Has anyone faced
> this issue? How to get rid of the blank space when the control is no
> longer visible?
>
>
> Pseudo code is..
>
> // Add bannana
> Text bannana = new Text(parent, SWT.Border);
> bannana.setLayoutData( new GridData());
>
> // Add mango
> Text mango = new Text(parent, SWT.Border);
> mango.setLayoutData( new GridData());
>
>
> //... Some where down in the code..
>
> if(userchoice == magno) {
> bannana.setVisible(false);
> mango.setVisible(true);
> parent.pack(true);
> }else {
> bannana.setVisible(true);
> mango.setVisible(false);
> parent.pack(true);
> }
> ** I see a blank link in the form display showing empty space for the
> widget that has visibility "false" ***
>
> Thanks for your help!!
>
> -Meera
>
>

I face the same problem.
One solution would be to write a own Layout manager and check if the
widget is visible or not. If not visible do not place the widget.

I'm not 100% satisfied with this method, probably someone else knows more...

Tom
Re: Blank space after widget is not visible. [message #439434 is a reply to message #439367] Mon, 12 July 2004 17:54 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=49426

"Tom Kneubuehl" <kneubuehlt@post.ch> wrote in message
news:40f28952$1@news.post.ch...
> Meera wrote:
> > Hello,
> >
> > I am using GridLayout to display a form. The form makes some widget
> > controls "visible" and "invisible" based on user input.
> >
> > I am observing that form is showing blank space for the controls that
are
> > not visible. I am not able to get rid of the empty space. Has anyone
faced
> > this issue? How to get rid of the blank space when the control is no
> > longer visible?
> >
> >
> > Pseudo code is..
> >
> > // Add bannana
> > Text bannana = new Text(parent, SWT.Border);
> > bannana.setLayoutData( new GridData());
> >
> > // Add mango
> > Text mango = new Text(parent, SWT.Border);
> > mango.setLayoutData( new GridData());
> >
> >
> > //... Some where down in the code..
> >
> > if(userchoice == magno) {
> > bannana.setVisible(false);
> > mango.setVisible(true);
> > parent.pack(true);
> > }else {
> > bannana.setVisible(true);
> > mango.setVisible(false);
> > parent.pack(true);
> > }
> > ** I see a blank link in the form display showing empty space for the
> > widget that has visibility "false" ***
> >
> > Thanks for your help!!
> >
> > -Meera
> >
> >
>
> I face the same problem.
> One solution would be to write a own Layout manager and check if the
> widget is visible or not. If not visible do not place the widget.
>
> I'm not 100% satisfied with this method, probably someone else knows
more...
>
> Tom
Previous Topic:what's GP in the article: " SWT: The Standard Widget Toolkit - Part 1"
Next Topic:Event Handing
Goto Forum:
  


Current Time: Wed Apr 24 23:28:11 GMT 2024

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

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

Back to the top