wxpython rearrange bitmap on resize

Attached code

I have this wxpython code, where I am display images along with text. I am using flexgridsizer. I want when I resize the window, images should reshuffle as per the size like if there is more room than the column/row should expand, also I see flicker while regenerating images.

Please suggest if there is anyother better way to do this

flexGridsizer.py (2.67 KB)

Kavita Kumawat wrote:

Attached code

I have this wxpython code, where I am display images along with text. I
am using flexgridsizer. I want when I resize the window, images should
reshuffle as per the size like if there is more room than the column/row
should expand,

It sounds like you want something like the wx.WrapSizer, but it was introduced in 2.9 so you'll need to upgrade.

also I see flicker while regenerating images.

Don't regenerate. Just create the widgets once and move them (or remove from the old sizer and add them to the new) when you need to reorganize.

···

--
Robin Dunn
Software Craftsman

Thanks Robin,

I upgraded and it solved the realign issue, but for flicker I don’t get the part don’t regenerate?? Do you mean the sizers?

Sorry I am little new to this stuff, but if you have seen my code… can you suggest which part I can improve

···

On Friday, 11 April 2014 06:09:31 UTC+5:30, Robin Dunn wrote:

Kavita Kumawat wrote:

Attached code

I have this wxpython code, where I am display images along with text. I

am using flexgridsizer. I want when I resize the window, images should

reshuffle as per the size like if there is more room than the column/row

should expand,

It sounds like you want something like the wx.WrapSizer, but it was
introduced in 2.9 so you’ll need to upgrade.

also I see flicker while regenerating images.

Don’t regenerate. Just create the widgets once and move them (or remove
from the old sizer and add them to the new) when you need to reorganize.


Robin Dunn

Software Craftsman

http://wxPython.org

Kavita Kumawat wrote:

Thanks Robin,

I upgraded and it solved the realign issue, but for flicker I don't get
the part don't regenerate?? Do you mean the sizers?

No, I meant to not Destroy() the static bitmaps and other widgets and then make new ones. Just create them once and reuse the existing ones as much as possible when you change the layout.

···

--
Robin Dunn
Software Craftsman