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 962441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:30:24+00:00 2026-05-16T01:30:24+00:00

I am trying to make a ScrolledWindow that can scroll over a grid of

  • 0

I am trying to make a ScrolledWindow that can scroll over a grid of images, but the scrollbar isn’t appearing. wxWidgets documentation says:

The most automatic and newest way [to set the scrollbars in wxScrolledWindow] is to simply let sizers determine the scrolling area. This is now the default when you set an interior sizer into a wxScrolledWindow with wxWindow::SetSizer. The scrolling area will be set to the size requested by the sizer and the scrollbars will be assigned for each orientation according to the need for them and the scrolling increment set by wxScrolledWindow::SetScrollRate

So I try to set the sizer of my ScrolledWindow with a GridSizer but it’s not working. The code:

import wx

class MyFrame(wx.Frame):

    def __init__(self, parent, id=-1,title="",pos=wx.DefaultPosition,
         size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE,
         name="frame"):

        wx.Frame.__init__(self,parent,id,title,pos,size,style,name)

        self.panel = wx.ScrolledWindow(self,wx.ID_ANY)

        menuBar = wx.MenuBar()
        menu1 = wx.Menu()
        m = menu1.Append(wx.NewId(), "&Blah", "Show Pictures")
        menuBar.Append(menu1,"&Blah")
        self.Bind(wx.EVT_MENU,self.OnInit,m)

        self.SetMenuBar(menuBar)

    def OnInit(self, event):

        sizer = wx.GridSizer(rows=7,cols=3)

        filenames = []
        for i in range(20):
            filenames.append("img"+str(i)+".png")
        for fn in filenames:
            img = wx.Image(fn,wx.BITMAP_TYPE_ANY)
            sizer.Add(wx.StaticBitmap(self.panel,wx.ID_ANY,wx.BitmapFromImage(img)))

        self.panel.SetSizer(sizer)

class MyApp(wx.App):

    def OnInit(self):

        self.frame = MyFrame(parent=None,title="Frame")
        self.frame.Show()
        self.SetTopWindow(self.frame)
        return True

if __name__ == "__main__":

    app = MyApp()
    app.MainLoop()
  • 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-16T01:30:25+00:00Added an answer on May 16, 2026 at 1:30 am

    Insert this

    self.panel.SetScrollbars(1, 1, 1, 1)
    

    after self.panel = wx.ScrolledWindow(self,wx.ID_ANY)

    If you want some info on the SetScrollBars method then look at this wxwidgets documentation page

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying make one treeView with infinite subgroups. I can add my groups but
trying to make 5 curl childs for curl handler and defining them, but can't
Trying to make a make generic select control that I can dynamically add elements
Trying to make a simple scroll to top button that smoothly scrolls up and
Trying to make a regex that can handle input like either: Beverly Hills, CA
I'm trying make an entity with doctrine that has three associations with other entities
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
Trying to make a small countdown timer in my app but it's not working.
im trying make one replace in string from a array but this dont work
Trying to make a sliding panel where you can click next and back to

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.