Skip to main content



      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 14: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 08:51 Go to previous messageGo to next message
Eclipse UserFriend
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 13:54 Go to previous message
Eclipse UserFriend
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: Tue Jul 08 09:28:21 EDT 2025

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

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

Back to the top