I want to maximize a panel, which is run from one event bind, to maximize
the frame is not maximize the panel.
My code:
self.panel = wx.Panel(self, -1)
self.Bind(wx.EVT_TOOL, self.OnText, id = ID_TEXT)
...
def OnText(self, evt):
self.panel = Text(self, -1)
self.panel.Show()
Any suggestions?
Hi, I do not quite understand what you want to do, Do you want to make
the panel fill the size of the frame? Are you using sizers?
Yes,
The panel is the same size as the frame without maximize,when maximizes the
frame the panel is not maximized together with the frame, attached a image
You can't simply just reassign the 'self.panel' attribute and expect
it to swap out the layout in your frame with the item that was
previously assigned to self.panel as that object still exists in the
layout and the new item will just be put at 0,0 with its default size.
You should set up your frame as follows
Frame
>
+- Main Panel
>
+ SubPanel1 (Text)
The Main Panel can be used to control what one of your sub panels is
shown at any given time. Here are a couple ways to do it.
* Use a Sizer and swap the items out when changing to a new one, using
the EXPAND flag when adding it to the sizer.
* Use a book control for the main panel and switch what page is
selected (there is a ToolBook class that will take care of your
toolbar too (though its a generic control and doesn't look very good
on wxMac).
Cody
···
On Fri, Aug 14, 2009 at 10:24 AM, Jair Gaxiola<jyr.gaxiola@gmail.com> wrote:
On Fri, Aug 14, 2009 at 3:03 AM, C M <cmpython@gmail.com> wrote:
On Fri, Aug 14, 2009 at 1:22 AM, Jair Gaxiola <jyr.gaxiola@gmail.com> >> wrote:
I commented out all the code related to the toolbar since you didn’t include the icons. Anyway, it worked fine for me after I did that (as far as I can tell). I’m on Windows XP, Python 2.5, wxPython 2.8.10.1 (msw-unicode)