python 3.x - wxPython StaticBitmap behavior changed withbefore version 4.2.2? - Stack Overflow

In the course of buying a new laptop, I've upgraded wxPython to version 4.2.2, and in an otherwise

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
Add a comment  | 

1 Answer 1

Reset to default 1

As 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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信