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

  • Home
  • SEARCH
  • 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 3876442
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:22:56+00:00 2026-05-19T22:22:56+00:00

I have a little app that I am working on with wxPython. I have

  • 0

I have a little app that I am working on with wxPython.

I have a scrolled window using wx.ScrolledWindow. It seems to refuse to repaint the contents when it is scrolled.

Example:
Yes, my window-manager color-scheme is Pink. What of it?

Code that created above example:

import wx


class SaveEdFrame(wx.Frame):
    def __init__(self, *args, **kwds):
        kwds["style"] = wx.DEFAULT_FRAME_STYLE|wx.EXPAND
        wx.Frame.__init__(self, *args, **kwds)

        self.__do_layout()

        self.Bind(wx.EVT_SIZE, self.onSize)


    def __mainSizer(self):
        self.mainSizer = wx.BoxSizer(wx.VERTICAL)

        for key in xrange(30):
            self.headerLabel = wx.StaticText(self, -1, "TestStr %s" % key)
            self.mainSizer.Add(self.headerLabel)
        return self.mainSizer


    def __do_layout(self):
        ## begin wxGlade: SaveEdFrame.__do_layout

        self.scroll = wx.ScrolledWindow(self, style=wx.FULL_REPAINT_ON_RESIZE)
        self.scroll.SetScrollbars(1, 10, 1, 10)
        self.scroll.SetSizer(self.__mainSizer())


    def onSize(self, event):
        self.scroll.SetSize(self.GetClientSize())

        self.Refresh()


if __name__ == "__main__":
    app = wx.App(0)

    mainFrame = SaveEdFrame(None)
    app.SetTopWindow(mainFrame)
    mainFrame.Show(True)
    app.MainLoop()

I’ve been digging through the wxDocs, and it seems to me that one solution would be to subclass wx.ScrolledWindow, manually catch wx.EVT_SCROLLWIN events, and then explicitly redraw the window, but my attempts to do that failed when calling self.Refresh() did not cause the interior of the wx.ScrolledWindow to repaint.

Anyways, it seems to me that the whole point of the wx.ScrolledWindow object is that it should handle repainting itself when scrolled.

What am I doing wrong?

Platform is W7-x64, python 2.7 32 bit, wxPython 2.8.11.0

  • 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-19T22:22:56+00:00Added an answer on May 19, 2026 at 10:22 pm

    I think the problem there is that your wx.StaticText widgets are children of the SaveEdFrame, not the ScrolledWindow. The ScrolledWindow is being redrawn over them as you scroll it. Try:

     headerLabel = wx.StaticText(self.scroll, -1, "TestStr %s" % key)
     self.mainSizer.Add(headerLabel)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a little logging app (written in wxPython) that receives data from a
I have a little app that downloads stock prices and was working perfectly (for
I have an app that I've written in C#/WinForms ( my little app ).
I have an app that I'm writing a little wizard for. It automated a
I'm currently working on a simple wxPython app that's essentially document based. So far
I have a little app that has been under development for some time. My
I currently am working on a little app that requests user info from my
I have made a little app for signing up for an event. User input
I have a simple little test app written in Flex 3 (MXML and some
I have a little pet web app project I'd like to show someone who

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.