Docking a child frame to parent frame - challenges on macOS

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Docking a child frame to parent frame - challenges on macOS

Datro
I'd like to setup the following in my Windows/Mac cross-platform GUI (I'm using wxPython 4.0.1 with Python 3.6.4):

  1. Parent frame includes a button to show/hide a child frame
  2. Child frame is positioned just below parent frame (spaced apart by a few pixels) and aligned with left side of parent frame
  3. Clicking on the show/hide button in parent frame does not change focus to the child frame
  4. Child frame tracks any movement of parent frame and stays aligned as above
  5. (Optional) Child frame cannot be separately moved, ie. it has no Title Bar
I've been able to achieve all of the above items on MSWindows.  The wx.MoveEvent provides tracking of the parent window, and I can successfully create the child frame without a Title bar (using wx.BORDER_SIMPLE).  Tracking of the child frame to the parent movement is very smooth and without any flicker.  Showing the hidden child frame does not remove focus from the parent frame.  It all works extremely well.

However, on macOS, I have found no way to achieve number "3" and "5".  I was worried also about number "4" as well since I read in the API doc that wx.MoveEvent was not available on macOS, however it seems to work (macOS High Sierra 10.13.6) though the tracking is not very smooth (very jerky).

Questions :

1. Is wx.MoveEvent actually supported/supposed to work on macOS (even though the doc says otherwise)?  Just wondering if the doc is out of date.
2. How can a frame be created on MacOS without a Title bar (or at least can it be fixed so that it is not moveable except through tracking the parent)?
3. Is there any way around the focus change from parent to child on macOS when a child window is switched to "Show" from the parent?  I've tried doing a self.Raise() on the parent and that works, but there is a 1-2 second delay before the parent gets the focus back - not really acceptable.

Thanks for any help.
Dave


--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Docking a child frame to parent frame - challenges on macOS

Tim Roberts
On Aug 1, 2018, at 10:13 AM, Datro <[hidden email]> wrote:

I'd like to setup the following in my Windows/Mac cross-platform GUI (I'm using wxPython 4.0.1 with Python 3.6.4):
  1. Parent frame includes a button to show/hide a child frame
  2. Child frame is positioned just below parent frame (spaced apart by a few pixels) and aligned with left side of parent frame
  3. Clicking on the show/hide button in parent frame does not change focus to the child frame
  4. Child frame tracks any movement of parent frame and stays aligned as above
  5. (Optional) Child frame cannot be separately moved, ie. it has no Title Bar
Have you considered putting all of the controls in a single frame, but just resize it so that the "child frame" controls are off the bottom edge?  You see this in some dialogs that have a More>> or <<Less buttons to show and hide additional controls.  It sounds like that would do everything you want, but it would be MUCH simpler than trying to track to separate windows.
— 
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Docking a child frame to parent frame - challenges on macOS

Datro


On Wednesday, August 1, 2018 at 6:51:59 PM UTC-4, Tim Roberts wrote:
On Aug 1, 2018, at 10:13 AM, Datro <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="jHaqVMVSCgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">dtr...@...> wrote:

Have you considered putting all of the controls in a single frame, but just resize it so that the "child frame" controls are off the bottom edge?  You see this in some dialogs that have a More>> or <<Less buttons to show and hide additional controls.  It sounds like that would do everything you want, but it would be MUCH simpler than trying to track to separate windows.
— 
Tim Roberts, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="jHaqVMVSCgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ti...@...
Providenza & Boekelheide, Inc.

Tim,
Thanks for your reply.  Yes, I've already prototyped the approach you suggest with a panel at the bottom of the frame that I show/hide.  It requires that the parent frame is resized for each show or hide, (and a few other lines of code to handle changing the "proportion" setting on the top part of my frame sizer to get the frame maximize behavior that I want) but it basically works.

The reason I want two separate but "docked" frames is that the parent frame is a matplotlib graph of decent size but the show/hide frame will contain a wx.listctrl that requires much less screen real estate than a full width panel below the graph.  There is a lot of wasted empty panel space if I use the single-frame approach and it just doesn't look good.  Using the two-frame approach I can actually setup the child panel to appear partially behind the parent frame which gives it a nice "fly out" appearance.  It really looks nice and works extremely well on Windows.

The good news is that I have now figured out how to get item "3" (no change in frame focus) working properly on the mac.  So the only remaining bit that I need to figure out is how to create a child frame on macOS with no title bar (i.e. the frame cannot be separately moved or closed).  Anyone have thoughts on that part?

Thanks.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.