WxPython widget missplaced after hide() & show()
Question: I'm trying to build a GUI for a school project for Boolean expressions
evaluation. This program takes a string as an input `A^B` and shows it's truth
table in the GUI with a Grid widget.

For some reasons (don't want to make this post too long) I need to Hide() and
Show() a panel with the only widget it has (the grid) but whenever I call
Hide() and Show() the panel is placed on the top-left corner of the parent
panel.

Let me clarify using some pictures:![Working as it should, panel in
place](http://i.stack.imgur.com/POII2.png)

The panel that I want to hide is the gray one just below the disabled TextCtrl
widget and, as you can see, I placed it where I wanted to. Now let's see after
hide() and show()

![Wrong place](http://i.stack.imgur.com/O4CWa.png)

Now the panel has been moved to the upper left corner of the screen.

This is how I'm implementing the panel:

    
    
        #Answer box panel
        self.panel_resp = sp.ScrolledPanel(midPan, -1) # midpan is the parent panel (blue)
        self.panel_resp.SetBackgroundColour('#FFFFFFF')
        resp_sizer = wx.BoxSizer(wx.HORIZONTAL)
        self.panel_resp.SetSizer(resp_sizer)
        self.panel_resp.SetAutoLayout(1)
        self.panel_resp.SetupScrolling()
        self.vbox1.Add(self.panel_resp, flag=wx.EXPAND|wx.ALL,
                       border=10)
        self.vbox1.Add((-1,10))
    
        self.panel_resp.Hide()
    

Now, whenever I click the 'Evaluar' button, I make the following statement:

`self.panel_resp.Show()`

And the panel shows up in that corner.

Any idea on why is this happening?

I didn't want to fill this post with my code since it's quite huge but I'll
gladly answer any questions about it, I just posted that part since I think
that's the only important one.


Answer: I think Show() just makes hidden components visible. Assuming self.vbox1 is
the sizer for midpan, try doing a `self.vbox1.Layout()` manually to tell it to
move everything to the right spot manually.

