Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Hiding controls
Hiding controls [message #466913] Thu, 19 January 2006 06:32 Go to next message
Joseph Rignanese is currently offline Joseph RignaneseFriend
Messages: 16
Registered: July 2009
Junior Member
Hi guys,

I'm looking to completely hide a control. The setVisible stops the control
from displaying (a good start) but it still reserves the space in my
GridLayout for the control. Is there anyway I can stop this from happening
(I want to set the height of the control to 0 pixels).

Also is there anyway to clear the contents of a Composite control? I have a
class that extends Composite, but I want to be able to clear the contents of
it.

Thanks in advance,

Joe
Re: Hiding controls [message #466922 is a reply to message #466913] Thu, 19 January 2006 13:40 Go to previous messageGo to next message
hortiz Mising name is currently offline hortiz Mising nameFriend
Messages: 96
Registered: July 2009
Member
To hide a control, you can set the exclude attribute of the associated
GridData to true (you still have to set the visibility of the control to
false) :

controlGridData.exclude = true;
control.setVisible(false);


To remove all the contents of a composite, you can try to iterate over
composite.getChildren() and set each of it to null.


Helene

Joseph Rignanese wrote:

> Hi guys,

> I'm looking to completely hide a control. The setVisible stops the control
> from displaying (a good start) but it still reserves the space in my
> GridLayout for the control. Is there anyway I can stop this from happening
> (I want to set the height of the control to 0 pixels).

> Also is there anyway to clear the contents of a Composite control? I have a
> class that extends Composite, but I want to be able to clear the contents of
> it.

> Thanks in advance,

> Joe
Re: Hiding controls [message #466938 is a reply to message #466922] Thu, 19 January 2006 14:53 Go to previous messageGo to next message
Jeremy Dowdall is currently offline Jeremy DowdallFriend
Messages: 48
Registered: July 2009
Member
being SWT controls, those children should be removed by calling
"dispose" - child.dispose - to free up the system resources

hortiz wrote:
> To hide a control, you can set the exclude attribute of the associated
> GridData to true (you still have to set the visibility of the control to
> false) :
>
> controlGridData.exclude = true;
> control.setVisible(false);
>
>
> To remove all the contents of a composite, you can try to iterate over
> composite.getChildren() and set each of it to null.
>
>
> Helene
>
> Joseph Rignanese wrote:
>
>> Hi guys,
>
>
>> I'm looking to completely hide a control. The setVisible stops the
>> control from displaying (a good start) but it still reserves the space
>> in my GridLayout for the control. Is there anyway I can stop this from
>> happening (I want to set the height of the control to 0 pixels).
>
>
>> Also is there anyway to clear the contents of a Composite control? I
>> have a class that extends Composite, but I want to be able to clear
>> the contents of it.
>
>
>> Thanks in advance,
>
>
>> Joe
>
>
Re: Hiding controls [message #466954 is a reply to message #466938] Thu, 19 January 2006 21:42 Go to previous message
Joseph Rignanese is currently offline Joseph RignaneseFriend
Messages: 16
Registered: July 2009
Junior Member
Thanks both of you for the response :)

"Jeremy Dowdall" <jeremyd@aspencloud.org> wrote in message
news:dqo955$fvm$1@utils.eclipse.org...
> being SWT controls, those children should be removed by calling
> "dispose" - child.dispose - to free up the system resources
>
> hortiz wrote:
>> To hide a control, you can set the exclude attribute of the associated
>> GridData to true (you still have to set the visibility of the control to
>> false) :
>>
>> controlGridData.exclude = true;
>> control.setVisible(false);
>>
>>
>> To remove all the contents of a composite, you can try to iterate over
>> composite.getChildren() and set each of it to null.
>>
>>
>> Helene
>>
>> Joseph Rignanese wrote:
>>
>>> Hi guys,
>>
>>
>>> I'm looking to completely hide a control. The setVisible stops the
>>> control from displaying (a good start) but it still reserves the space
>>> in my GridLayout for the control. Is there anyway I can stop this from
>>> happening (I want to set the height of the control to 0 pixels).
>>
>>
>>> Also is there anyway to clear the contents of a Composite control? I
>>> have a class that extends Composite, but I want to be able to clear the
>>> contents of it.
>>
>>
>>> Thanks in advance,
>>
>>
>>> Joe
>>
Previous Topic:Buttons stay when window is maximized
Next Topic:Force Browser Repaint
Goto Forum:
  


Current Time: Sun Aug 18 23:13:18 GMT 2019

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

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

Back to the top