Soooo, I was playing around just to get a used to certain parts of wxPython that I’ve never used before: namely painting, scrolling, and all that jazz.
The goal was to create a frame that would display images down on the left side, and have stuff about the image on the right. Since images can be any ol’ size, I’d dynamically resize them as the frame changed size, so that they were never wider then half the width of the frame, while keeping proportions right.
The basic layout of the windows is a vertical box sizer, with horizontal box sizers piled down it; the horizontals hold an ImagePanel, and a TextCtrl. The ImagePanel is the image and re-paints/re-sizes the image as appropriate, the TextCtrl is just to demonstrate something is there
After tons of iterations of sizers and scrolling widgets, I have it mostly right-- except when the window expands, the horizontal sizers never get taller as I’d want them to.
I think I know why: what I think I want is for the “virtual” depth in the scrolled area to get bigger as I make the window bigger, proportionally. But the “virtual” size isn’t changing, so as I make the window wider, the virtual depth is actually no different. But I have no idea how to change that behavior This is my first time ever getting near scrolled windows or painting or any of this jazz
I attached a trimmed down test-case to demonstrate: it should just run and work. (My sample image directory is represented as big black boxes of varying sizes in the test-case, so you can see exactly what I’m looking at without having all the pictures of flowers and deer :P)
(This is wxPython 2.8 + Python 2.4 on OSX, but I tested it out on Windows and its about the same)
Any idea what I’m doing wrong? I think my understanding of the scrolled-fu may be off.
Thanks in advance.
testcase.py (5.75 KB)