"DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly
prohibited from using, copying, altering, or disclosing the contents of this message. Aricent accepts no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus."
You can't hide a sizer.
If you want to hide several items at once, you should put them all on a panel, put your sizer on the panel and the controls on the sizer.
Then, when you hide the panel, all of your controls will dissapear.
And you should call Layout for the parent window of the panel so it could rearrange itself to hide it.
···
Amit15.Kumar@aricent.com wrote:
hi All
can anybody tell me how to hide sizer.
I have creted one window x under that sizer s.
i m trying hide this sizer by using
s->Show(s,FALSE);
s->Layout();
but still its displaying me its children component(slider,button).
"DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly
prohibited from using, copying, altering, or disclosing the contents of this message. Aricent accepts no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus."
(self.box2) #the outer box sizer hides the inner box sizer
self.b1.SetLabel(“Pooof… no more ninja”)
self.box1.Layout() #if you don’t add this line the ninja will continue to distort the reality field and will be detectable by the space it dislocates
Hides the window, sizer, or item at index. To make a sizer item
disappear, use Hide() followed by Layout(). Use parameter recursive to
hide elements found in subsizers.
Damn...
I'm absolutely sure I tried that once and it didn't work.
Well, I stand corrected then.
Thanks.
Peter Damoc wrote:
···
On 2/8/07, *Eli Golovinsky* <gooli@tuzig.com <mailto:gooli@tuzig.com>> > wrote:
You can't hide a sizer.
are you sure? Here is an example that demonstrates the contrary. It works on Windows.
import wx
class TestFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title="Hide Sizer Example")
self.b1 =wx.Button(self, label = "Hide ninja, hide!")
self.b2 =wx.Button(self, label = "A regular, black claded ninja")
self.box1 =wx.BoxSizer(wx.VERTICAL)
self.box2 =wx.BoxSizer(wx.VERTICAL)
self.box1.Add(self.b1, 1, wx.EXPAND|wx.ALL, 10)
self.box2.Add(self.b2, 1, wx.EXPAND)
self.box1.Add (self.box2, 1, wx.EXPAND|wx.ALL, 10)
self.SetSizer(self.box1)
self.b1.Bind(wx.EVT_BUTTON, self.ThrowSmoke)
self.Show()
def ThrowSmoke(self, evt):
self.box1.Hide (self.box2) #the outer box sizer hides the inner box sizer
self.b1.SetLabel("Pooof... no more ninja")
self.box1.Layout() #if you don't add this line the ninja will continue to distort the reality field and will be detectable by the space it dislocates