In the code below, I want the right panel be “not visible” in the beginning, so I set its size to (0,0), but it is still visible when I run the script. What should I do:
import wx
import wx.grid as gridlib
···
########################################################################
class LeftPanel(wx.Panel):
“”""""
On Wednesday, July 30, 2014 11:54:46 AM UTC-7, steve wrote:
In the code below, I want the right panel be “not visible” in the beginning, so I set its size to (0,0), but it is still visible when I run the script. What should I do:
import wx
import wx.grid as gridlib
########################################################################
class LeftPanel(wx.Panel):
“”“”“”
But I want to use SetSize() method. Why doesn’t this method work?
···
On Wednesday, July 30, 2014 10:17:51 PM UTC+3, Nathan McCorkle wrote:
rightP.Show(False)
On Wednesday, July 30, 2014 11:54:46 AM UTC-7, steve wrote:
In the code below, I want the right panel be “not visible” in the beginning, so I set its size to (0,0), but it is still visible when I run the script. What should I do:
import wx
import wx.grid as gridlib
########################################################################
class LeftPanel(wx.Panel):
“”“”“”
why? you want it to not be visible -- make it not visible.
Why doesn't this method work?
it could have a MinSize that is non-zero -- I'm not sure the wx supports
zero-sized visible windows at all -- in any case, it's likely to be
platform dependent.
-Chris
···
On Wed, Jul 30, 2014 at 12:18 PM, steve <oslocourse@gmail.com> wrote:
On Wednesday, July 30, 2014 10:17:51 PM UTC+3, Nathan McCorkle wrote:
rightP.Show(False)
On Wednesday, July 30, 2014 11:54:46 AM UTC-7, steve wrote:
In the code below, I want the right panel be "not visible" in the
beginning, so I set its size to (0,0), but it is still visible when I run
the script. What should I do:
import wx
import wx.grid as gridlib
########################################################################
class LeftPanel(wx.Panel):
""""""
# Run the program
if __name__ == "__main__":
app = wx.App(False)
frame = MyForm()
frame.Show()
app.MainLoop()
--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
My guess is because it’s in a sizer, which is setting the size after/during the Show event (I could be wrong on that).
It is suggested that users always use a ‘main’ panel to add other stuff to… rather than adding other widgets directly to the Frame, or setting a sizer on the Frame.
I attempted some things, but they didn’t work. I definitely think it’s the sizer.
I didn’t check, but I added the widget inspector. Once the Frame is displayed, type CTRL-ALT-I and the inspector should pop up, letting you look through the size values for each widget.
On Wednesday, July 30, 2014 12:18:26 PM UTC-7, steve wrote:
But I want to use SetSize() method. Why doesn’t this method work?
On Wednesday, July 30, 2014 10:17:51 PM UTC+3, Nathan McCorkle wrote:
rightP.Show(False)
On Wednesday, July 30, 2014 11:54:46 AM UTC-7, steve wrote:
In the code below, I want the right panel be “not visible” in the beginning, so I set its size to (0,0), but it is still visible when I run the script. What should I do:
import wx
import wx.grid as gridlib
########################################################################
class LeftPanel(wx.Panel):
“”“”“”