I want to add dynamically captured images in hierarchical structure (one after one). I want to add them to wx.ScrolledPanel
ScrolledPanel definition - updated
self.hbox = wx.BoxSizer(wx.HORIZONTAL)
#self.sizer.Add(self.hbox)
self.scroll = scrolled.ScrolledPanel(self, id = -1, pos = wx.DefaultPosition, size = (500, 400), style= wx.SUNKEN_BORDER , name = "Scroll")
self.scroll.SetupScrolling(10,10,10,10)
#self.scroll.SetSizer(self.hbox)
self.sizer.Add(self.scroll)
#add to scroll
images = wx.StaticBitmap(self, id=-1, pos=wx.DefaultPosition,
size=(200,150),
style= wx.SUNKEN_BORDER)
images.SetBitmap(bmp)
self.hbox.Add(images, 1, wx.BOTTOM | wx.EXPAND | wx.ALL, 3)
self.scroll.SetSizer(self.hbox)
self.scroll.SetAutoLayout(1)
self.scroll.SetupScrolling()
self.SetSizerAndFit(self.sizer)
self.Refresh()
self.Layout()
- Python 2.6, windows 32bit
After update - I see scrollpanel
and I add images to sizer. But sizer is not displaying in scrollPanel.
Here is a crude but runnable example of what you want, there is a slight glitch in it thought that I haven't figured out the cause of yet! (You just need to put a thumbnail size jpg called "image.jpg" in the same directory as the script)