SetSize doesn't

1 view
Skip to first unread message

Bob Swithers

unread,
Jun 6, 2019, 6:01:45 PM6/6/19
to wxPython-dev
   I'm using WxPython 4.0.6, Python 3.7 on Win-10.

   I have many apps that save their frame's size and position upon exit, and restore it upon startup -- so the user's location/size preference is preserved across invocations.    For one app, however, it does not work at all, and SetSize does nothing.  (SetClientSize doesn't either.)  Absolutely no matter what I do, the resulting size is 400, 250 and the position is always the same.

    What is going on?  Or, how can I figure this out?

     Many thx in advance for any help.

show SetSize doing nothing.JPG


Robin Dunn

unread,
Jun 6, 2019, 7:07:04 PM6/6/19
to wxPython-dev


On Thursday, June 6, 2019 at 3:01:45 PM UTC-7, Bob Swithers wrote:
   I'm using WxPython 4.0.6, Python 3.7 on Win-10.

   I have many apps that save their frame's size and position upon exit, and restore it upon startup -- so the user's location/size preference is preserved across invocations.    For one app, however, it does not work at all, and SetSize does nothing.  (SetClientSize doesn't either.)  Absolutely no matter what I do, the resulting size is 400, 250 and the position is always the same.

    What is going on?  Or, how can I figure this out?

Is the MainLoop running yet? What's in the frame and how was it constructed? What else has or hasn't happened before the interactive code you showed?
 
--
Robin

Bob Swithers

unread,
Jun 6, 2019, 7:43:15 PM6/6/19
to wxPython-dev
Robin,
      Many thx for your reply and interest.
      No, the MainLoop is not yet running in the interactive code I showed.  However, I can breakpoint the program at any time after the MainLoop is running and get the same interactive session.

      The program is constructed with wxFormBuilder 3.9.0, as are my other apps. I've attached a number of files, one or more of the .jpg files might help you get the sense for how the Frame is constructed, as you asked.  (I hones

1.  'Inital display, undersized.jpg' -- the way the Frame looks after .Show(), regardless what I do with SetSize
2.  'Inital display, manually up-sized.jpg'   -- shows the entire frame after I've manually resized it (i.e., dragged the sizer corner).
3.  'final display, after program actions.jpg'  --  shows the frame after the prog has done some work and populated some fields.
4.   'wxformbuilder snapshot.jpg'  -- a snapshot of the frame construction in wxFormBuilder.
5.   'CCoS DB HistoryKeeper.fbp'  -- the entire wxFormBuilder file
6.   'viewGUIBase.py'  -- the Python/Wx file generated by wxFormBuilder

      Thx again.
Inital display, undersized.JPG
Inital display, manually up-sized.JPG
final display, after program actions.JPG
final display, after program actions.JPG
wxformbuilder snapshot.JPG
CCoS DB HistoryKeeper.fbp
viewGUIBase.py

Robin Dunn

unread,
Jun 7, 2019, 7:03:03 PM6/7/19
to wxPython-dev
On Thursday, June 6, 2019 at 4:43:15 PM UTC-7, Bob Swithers wrote:
Robin,
      Many thx for your reply and interest.
      No, the MainLoop is not yet running in the interactive code I showed.  However, I can breakpoint the program at any time after the MainLoop is running and get the same interactive session.

      The program is constructed with wxFormBuilder 3.9.0, as are my other apps. I've attached a number of files, one or more of the .jpg files might help you get the sense for how the Frame is constructed, as you asked.  (I hones



Set the frame's style to just wx.DEFAULT_FRAME_STYLE. Apparently the wx.TAB_TRAVERSAL style on frames causes the issue on Windows, it probably overlaps with some other frame-specific value or something. All the other styles you have set are already included in the default style value.

--
Robin


Bob Swithers

unread,
Jun 7, 2019, 7:26:38 PM6/7/19
to wxPython-dev
Robin,
     THANK YOU, THANK YOU, THANK YOU!
     I had spent hours on that, getting nowhere …
Reply all
Reply to author
Forward
0 new messages