Justin Gardner
Justin Gardner

Reputation: 625

Frame Inside a Frame WxPython

I have a quick question about WxPython. I would like to have frames inside of my main frame in a program. The user should not be able to move the frame. Any ideas you guys?

Thanks

Upvotes: 2

Views: 1982

Answers (3)

Mike Driscoll
Mike Driscoll

Reputation: 33111

I'm guessing the OP is talking about an MDI frame, which Microsoft created and has since decided to abandon. I think the OP should check out the wx.agw.aui widget set versus the wx.aui stuff since the former has been updated a lot and wx.aui has not. Plus the agw package is pure Python and thus much more hackable.

Upvotes: 1

uhz
uhz

Reputation: 2528

Maybe you mean MDI frame? (example http://www.java2s.com/Tutorial/Python/0380__wxPython/MDIframe.htm)

Upvotes: 2

acattle
acattle

Reputation: 3113

Could you provide some more information on what you're trying to accomplish? If the user shouldn't be able to move the frame, why do you want to use frames instead of just panels inside of a frame? If you want to have temporary popups to select files or display messages you can make dialogs.

Are you trying to make something like GIMP's interface where instead of one big window you have several small windows?

In wxPython, frames are windows (and they use the word "window" for something different) and panels are just boxes you can fill with stuff. You can organize this "stuff" in a panel using sizers, basically tables. You can even put panels inside of panels. Here's a good tutorial that shows you all of the important objects in wxpython and how to use them: http://wiki.wxpython.org/AnotherTutorial

Also, so far as I can tell, there's no way to prevent users from moving your frame in wxPython, althought you can stop them from resizing it. The various syle attributes can be found in the link below: http://docs.wxwidgets.org/2.8.11/wx_wxframe.html#wxframe

Upvotes: 0

Related Questions