In the course of buying a new laptop, I've upgraded wxPython to version 4.2.2, and in an otherwise-fine GUI application (including tree, forms, perspectives, ... all provided with wxPython), the placement of StaticBitmap controls on a Panel does not work anymore:
Instead of being laid out in a grid, the bitmaps all start from the origin (0,0), overlapping. The correct position is supplied to StaticBitmap() (as before with the old wxPython version), but seemingly the behavior of StaticBitmap or Panel or ... has changed.
In the documentation, there's the caveat that StaticBitmap is reliable only for small images, and larger images should use GenericStaticBitmap. Is that the point of change and failure?
Any pointers?
EDIT: Fot to mention: I also checked the wxPython version history and only found "added wrapper to GenericStaticBitmap" (v4.2.1) while searching for "StaticBitmap" - this should not affect the use of StaticBitmap, I think.
In the course of buying a new laptop, I've upgraded wxPython to version 4.2.2, and in an otherwise-fine GUI application (including tree, forms, perspectives, ... all provided with wxPython), the placement of StaticBitmap controls on a Panel does not work anymore:
Instead of being laid out in a grid, the bitmaps all start from the origin (0,0), overlapping. The correct position is supplied to StaticBitmap() (as before with the old wxPython version), but seemingly the behavior of StaticBitmap or Panel or ... has changed.
In the documentation, there's the caveat that StaticBitmap is reliable only for small images, and larger images should use GenericStaticBitmap. Is that the point of change and failure?
Any pointers?
EDIT: Fot to mention: I also checked the wxPython version history and only found "added wrapper to GenericStaticBitmap" (v4.2.1) while searching for "StaticBitmap" - this should not affect the use of StaticBitmap, I think.
Share Improve this question asked Mar 7 at 9:32 virtualnobivirtualnobi 1,1902 gold badges12 silver badges37 bronze badges 1- I believe you will have to provide an MWE and/or much more information. Are the bitmaps laid out with a sizer? What platform and OS? – Infinity77 Commented Mar 7 at 21:09
1 Answer
Reset to default 1As every so often, a trivial mistake: The position parameters for the origin were not converted to int, but were floating point values. I can't believe the old laptop had a resolution which never resulted in .5 floats, but applying int(...) solves the issue.
Switching to wx.GenericStaticBitmap didn't help, by the way.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744938772a4602191.html
评论列表(0条)