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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:58:09+00:00 2026-06-05T20:58:09+00:00

I understand there are lots of settings for setting layouts. Here is a ListCtrl

  • 0

I understand there are lots of settings for setting layouts. Here is a ListCtrl of fixed dimensions inside a horizontal sizer.

enter image description here

This absolute size either displays leftover space or is too small depending on number of columns.

What are the layout commands to draw a ListCtrl?

How do I make the ListCtrl more responsive, so that it:

  • shows data from many columns at a glance without needing a resize
  • doesnt become bad on different GUIs and resizes

Code listing for the panel that hosts the list:

class CalcPanel(wx.Panel):
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)

        self.lc = wx.ListCtrl(self, -1, size=(200,200), style=wx.LC_REPORT)
        self.lc.InsertColumn(0, 'State')
        self.lc.InsertColumn(1, 'Capital')
        #self.lc.SetColumnWidth(0, 140)
        #self.lc.SetColumnWidth(1, 153)
    #self.list_ctrl.Show()

        self.sizer = wx.BoxSizer(wx.HORIZONTAL)

        btn = wx.Button(self, label="Add Line")

        self.sizer.Add(btn)
        self.sizer.Add(self.lc, 1, wx.LEFT | wx.TOP | wx.GROW)
        self.SetSizer(self.sizer)
        self.Fit()

    def InitUI(self):
    pass
  • 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-06-05T20:58:10+00:00Added an answer on June 5, 2026 at 8:58 pm

    Have you looked at wx.lib.mixins.listctrl.ListCtrlAutoWidthMixin?

    if you inherit from wx.lib.mixins.listctrl.ListCtrlAutoWidthMixin as well as wx.ListCtrl, and call the classes __init__ in your __init__ method the last column will auto resize with resize events

    You can also change which column auto resizes with setResizeColumn

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

Sidebar

Related Questions

I understand that there is a setting in Sun JVM for dumping the heap
Why only one overload throws this exception? Little update: I understand that there was
There are lots of questions that ask this or a similar question. They all
There are lots of examples on this site about adding to NSMutableArray and I
There are lots of recursion questions and I basically understand some simple recursion algorithm
I understand there is a limit to the number of requests per day using
I don't understand why there is no inheritance in Java annotations, just as Java
Are there overall rules/guidelines for what makes a method thread-safe? I understand that there
Just to preface my question, I understand that there is no direct support for
There is something I dont understand in core data. I have created a NSManagedDocument,

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.