Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1021465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:18:54+00:00 2026-05-16T11:18:54+00:00

I want to add dynamically captured images in hierarchical structure (one after one). I

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:18:54+00:00Added an answer on May 16, 2026 at 11:18 am

    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)

    import wx
    import  wx.lib.scrolledpanel as scrolled
    
    class ImageDlg(wx.Dialog):
        def __init__(self, parent, title):
            wx.Dialog.__init__(self, parent=parent,title=title, size=wx.DefaultSize)
    
            self.scrollPnl = scrolled.ScrolledPanel(self, -1, size=(200, 200), style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER)
    
            self.addBtn = wx.Button(self, id=wx.ID_ADD)
            self.Bind(wx.EVT_BUTTON, self.on_add, self.addBtn)
    
            self.mainSizer = wx.BoxSizer(wx.VERTICAL)       
    
            self.scrollPnlSizer = wx.BoxSizer(wx.VERTICAL)       
            img = wx.Image("image.jpg", wx.BITMAP_TYPE_ANY)
            staticBitmap = wx.StaticBitmap(self.scrollPnl, wx.ID_ANY, wx.BitmapFromImage(img))
            self.scrollPnlSizer.Add(staticBitmap, 1, wx.EXPAND | wx.ALL, 3)
    
            self.mainSizer.Add(self.addBtn)
            self.mainSizer.Add(self.scrollPnl)
    
            self.SetSizerAndFit(self.mainSizer)
    
    
        def on_add(self, event):
            img = wx.Image("image.jpg", wx.BITMAP_TYPE_ANY)
            staticBitmap = wx.StaticBitmap(self.scrollPnl, wx.ID_ANY, wx.BitmapFromImage(img))
            self.scrollPnlSizer.Add(staticBitmap, 1, wx.EXPAND | wx.ALL, 3)
            self.scrollPnl.SetSizer(self.scrollPnlSizer)
            self.scrollPnl.SetAutoLayout(1)
            self.scrollPnl.SetupScrolling()  
    
            self.Refresh()
            self.Layout()
    
    class TestPanel(wx.Panel):     
        def __init__(self, parent):
            wx.Panel.__init__(self, parent=parent)
    
            openDlg_btn = wx.Button(self, label="Open Dialog")
            self.Bind(wx.EVT_BUTTON, self.onBtn)
    
            mainSizer = wx.BoxSizer(wx.HORIZONTAL)
            mainSizer.Add(openDlg_btn, 0, wx.ALL, 10)
            self.SetSizerAndFit(mainSizer)
            self.Centre()
    
        def onBtn(self, event):
            dlg = ImageDlg(self, title='Image Dialog')
            dlg.SetSize((300,300))
    
            dlg.CenterOnScreen()
            dlg.ShowModal()  
            dlg.Destroy()
    
    
    class TestFrame(wx.Frame):    
        def __init__(self, parent):
            wx.Frame.__init__(self, parent)
            TestPanel(self)
    
    
    if __name__ == "__main__":
    
        app = wx.PySimpleApp()
        frame = TestFrame(None)
        frame.Show()
        app.MainLoop()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want create some view, and add dynamically to it text and images Somebody
I am using iCarousel as shownh here .But I want to add images dynamically
HI.. i want to add elements dynamically to listview in QT for symbian OS,
Suppose you want to dynamically add to a HTML menu, where the menu HTML
I have Panel with a BottomToolbar . I want to add and remove dynamically
I want to add class atttributes to a superclass dynamically. Furthermore, I want to
I want to add three labels into a cell dynamically, cell is created dynamically
I want to add and fetch the value from dynamically created textfield with tag
I want to add large string content to a container dynamically. There are 60
I want to give users the possibility to dynamically add new columns at the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.