[wxPython-users] wx.MDIChildFrame = tabbed window (Linux)? / design problems

Robin Dunn robin at alldunn.com
Wed Apr 4 14:38:28 PDT 2007


Bjoern Schliessmann wrote:

> This code gives me tabbed windows! :( I'd like to have a real MDI
> window environment -- I'm simulating a third-party software which
> uses MDI and I cannot change the design.
> 
> Is there an error in the above code? I suppose not, perhaps MDI
> is "windows-only".

Correct.  MDI is a Microsoft invention that nearly everyone else wisely 
chose to not copy.  So wxWidgets simulates it on wxGTK with a 
wx.Notebook instead.  (I once used a GUI toolkit that tried to fully 
emulate MDI on X-Windows systems.  It was about the crappiest UI thing 
I've ever seen.)


> 
> How could I simulate MDI-like behaviour? My needs are
> 1. client windows always on top of parent
> 2. client windows not movable outside of parent
> 3. client windows and parent window have different menu bar
> 

You'd probably be better off to just either use multiple single document 
windows (IOW, multiple top level frames) or a single main window with 
floating "tool" windows depending on your needs.  Even Microsoft uses 
this interface now and doesn't use MDI any more.


> - An empty wx.Panel parented to a wx.Frame always seems to have
> (0,0) as size. Normal? I'd just like to have a coordinate system
> local to the Frame, excluding the menu bar (so an object at local
> (0,0) is directly at the menu bar's low border).

That's normal if you don't do anything to cause the panel be sized to 
fill its alloted space.  Either make it be the only child of the frame, 
or put it in a sizer with the other frame children.

> 
> - Also, I can't figure out how to suppress horizontal scroll bars in
> a wx.ListView. Is there any way? I'd like to have a text item list
> (single column) which is resizable in up/down dimension, and
> colorable. wx.ListBox didn't work for me because SetItemColour
> seemingly has no effect there. 


Make the column be as wide as the listctrl minus the horizontal size of 
the vertical scrollbar.  There is the 
wx.lib.mixins.listctrl.ListCtrlAutoWidthMixin class to help with this if 
you want to use it.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list