I have been avoiding wxPython 2.9 for years because every time I tried to use it it broke layout of all my apps in a certain way. Yesterday I thought that it is time to try again - and this time be more thorough on investigating why is my layout broken…
Well, I have found that default size of buttons changed to slightly bigger (from (75, 23) to (88, 26)) which in effect changed size of nearly everything in my sizers. Not a big deal as I can fix my layouts to accommodate for this. I thought that it is fine (even when annoying) because I have noticed that system dialogs started to use bigger buttons in Windows 7 too so it is going to be more consistent.
But then during my testing I have noticed that in 2.9 in fact message box does not have a new bigger button. And that is does not look like the native system message box either. Also it does not center if there is another window on screen. However it works fine in 2.8, also the message box is perfectly matching the system one.
Can someone elaborate on the changes introduced in 2.9? Should I wait and still use 2.8? I am confused :-).
I have been avoiding wxPython 2.9 for years because every time I tried to use it it broke layout of all my apps in a certain way. Yesterday I thought that it is time to try again - and this time be more thorough on investigating why is my layout broken...
Well, I have found that default size of buttons changed to slightly bigger (from (75, 23) to (88, 26)) which in effect changed size of nearly everything in my sizers. Not a big deal as I can fix my layouts to accommodate for this. I thought that it is fine (even when annoying) because I have noticed that system dialogs started to use bigger buttons in Windows 7 too so it is going to be more consistent.
But then during my testing I have noticed that in 2.9 in fact message box does not have a new bigger button. And that is does not look like the native system message box either. Also it does not center if there is another window on screen. However it works fine in 2.8, also the message box is perfectly matching the system one.
Can someone elaborate on the changes introduced in 2.9? Should I wait and still use 2.8? I am confused :-).
I would think it is a good time to switch to 2.9, especially in preparation for Phoenix.
Sizers have changed a bit in 2.9, which probably is an additional reason for you layout issues.
Have you seen the "site-packages/wx-2.9.5-msw/docs/CHANGES.html"
Just looked at 2.8 and 2.9 MessageDialog in the demo and they look just about the same, the 2.9 is slightly larger and this is on Win 7.
Thanks for the reply. I have been looking at the document and I did not notice any sizer changes. Anyway, it seems that my layout issue is that I am relying on wx.TextCtrl having roughly same height as wx.Button in 2.8 (21 vs 23 px) which is not true anymore in 2.9 (21 vs 26 px).
However MessageBox does not seem right to me. In demo using MessageDialog it looks roughly the same. But in my example (attached to fist post) it is quite different and does not center itself when using MessageBox. I have attached screenshot. I have been experimenting with various versions so maybe there is something wrong with my installation.
Thanks for the reply. I have been looking at the document and I did not notice any sizer changes.
In 2.9.01 there is:
Sizers distribute only the extra space between the stretchable items according to their proportions and not all available space. We believe the new behaviour corresponds better to user expectations but if you did rely on the old behaviour you will have to update your code to set the minimal sizes of the sizer items to be in the same proportion as the items proportions to return to the old behaviour.
You are using GridBagSizer, there is also in 2.8.8.1:
Fixed a bug in wx.GridBagSizer where hidden items were not ignored in part of the layout algorithm.
There is also the SetEmptyCellSize thingy which caught me a few times.
But then during my testing I have noticed that in 2.9 in fact message
box does not have a new bigger button. And that is does not look like
the native system message box either. Also it does not center if there
is another window on screen. However it works fine in 2.8, also the
message box is perfectly matching the system one.
IIRC, in 2.9 we switched to the native TaskDialog instead of using the old MessageBox API.
This lets us do things like change button labels and some other capabilities. It will fallback to the old MessageBox if the task dialog is not available (like on XP or if the library was built with an old SDK, etc.)
Thanks for the explanation. However something is probably broken if the MessageBox does not center itself, the center flag should be default if I am not mistaken. And I guess I cannot actually control the TaskDialog aspects as described here About Task Dialogs - Win32 apps ?
···
–
Fenikso
Dne úterý, 9. dubna 2013 23:07:13 UTC+2 Robin Dunn napsal(a):
IIRC, in 2.9 we switched to the native TaskDialog instead of using the
old MessageBox API.
Thanks for the explanation. However something is probably broken if the
MessageBox does not center itself, the center flag should be default if
I am not mistaken. And I guess I cannot actually control the TaskDialog
aspects as described here About Task Dialogs - Win32 apps
?
BTW, in my tests it looks like it is centered over the parent or over the tlw set as the app object's top window if no parent is given. If you look closer at the docs it does say that the center flag is ignored on MSW.