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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:02:42+00:00 2026-05-22T23:02:42+00:00

I have a form that uses wxpython, one of the objects on the form

  • 0

I have a form that uses wxpython, one of the objects on the form displays the users windows logon name.

self.stIwpcadmin = wx.StaticText(self.panelLower, -1, "NONE")

Of course I don’t know what the name is until runtime so I create a wxStatic object with the label of ‘NONE’, and then at runtime it gets the username and changes the label

sUsername = getpass.getuser()
self.stIwpcadmin.SetLabel('WINDOWS/'+sUsername)

When this occurs it does update the text of the wxStatic object. The problem is that it ‘runs’ into the next object in the GridSizer. If I adjust the size of the window (any amount, larger or smaller) it forces the object to redraw and it fills in the text correctly.

How can I force this to occur with needing the user to change the window size?

This is the code that shows the sizer data for wxStatic info. I cut some code out to keep it as brief as possible. In short self.stIwpcadmin -> grid_sizer_1 -> sizerPassword -> sizerLower -> self.panelLower -> mainSizer

def __do_layout(self):
    # begin wxGlade: mainFrame.__do_layout
    mainSizer = wx.GridSizer(2, 1, 0, 0)
    sizerLower = wx.GridSizer(1, 2, 0, 0)
    sizerInstall = wx.StaticBoxSizer(self.sizerInstall_staticbox, wx.HORIZONTAL)
    sizerInstallButtons = wx.GridSizer(1, 2, 0, 0)
    sizer_4 = wx.BoxSizer(wx.VERTICAL)
    sizerPassword = wx.StaticBoxSizer(self.sizerPassword_staticbox, wx.HORIZONTAL)
    grid_sizer_1 = wx.GridSizer(8, 3, 0, 0)
    mainSizer.Add(self.panelUpper, 1, wx.EXPAND, 0)
    grid_sizer_1.Add(self.stIwpcadmin, 0, wx.ALL|wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 2)
    grid_sizer_1.Add(self.txIwpcadmin, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 2)
    grid_sizer_1.Add(self.btnIwpcadmin, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 2)
    grid_sizer_1.Add(self.panel_1, 1, wx.EXPAND, 0)
    grid_sizer_1.Add(self.panel_2, 1, wx.EXPAND, 0)
    grid_sizer_1.Add(self.btnValidateAll, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 2)
    sizerPassword.Add(grid_sizer_1, 1, wx.EXPAND, 0)
    sizerLower.Add(sizerPassword, 1, wx.EXPAND, 0)
    self.panelLower.SetSizer(sizerLower)
    mainSizer.Add(self.panelLower, 1, wx.EXPAND, 0)
    self.SetSizer(mainSizer)
    mainSizer.Fit(self)
    self.Layout()
  • 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-22T23:02:43+00:00Added an answer on May 22, 2026 at 11:02 pm

    You need to force the sizer to redo its layout using the aptly-named Layout method.

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

Sidebar

Related Questions

I have a windows form application that uses a Shared class to house all
I have a web form that uses AD to authenticate users. I want to
hey there everyone. so, have a c# windows form that uses crystal reports and
I have a form that uses jQuery to submit an ajax post and it
The basics: I have a contact form that uses php to validate the forms.
I have a basic CRUD form that uses PageMethods to update the user details,
I have a web report that uses a Django form (new forms) for fields
I have form that displays several keywords (standard set of choice lists that changes
I have a form that uses the excellent jQuery validation plugin. This is a
I have a form that uses PHP to calculate a total based on 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.