WxListBox

Discussion in 'Python' started by LutherRevisited, Dec 26, 2004.

  1. I'm wanting to put a listbox in the place of a textctrl I'm using in my
    application because I'm running out of space in my textctrl. The online
    documentation is down at wxpython.org so I have no idea how to construct this
    control or anything. Can someone help me out. Here's what I'm doing with the
    WxTextCtrl:

    self.text_ctrl_4 = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE)
    sizer_1.Add(self.text_ctrl_4, 6, wx.LEFT|wx.RIGHT|wx.EXPAND, 80)
    self.text_ctrl_4.AppendText(str(count) + '\t\t' + str(address) + '\t\t'
    + str(pageNumber) + '\t\t' + str(pageArray[pageNumber, 1]) +'\r\n')

    I'm wanting to implement something similar with a listbox, any thoughts?
     
    LutherRevisited, Dec 26, 2004
    #1
    1. Advertising

  2. LutherRevisited

    Steve Holden Guest

    LutherRevisited wrote:

    > I'm wanting to put a listbox in the place of a textctrl I'm using in my
    > application because I'm running out of space in my textctrl. The online
    > documentation is down at wxpython.org so I have no idea how to construct this
    > control or anything. Can someone help me out. Here's what I'm doing with the
    > WxTextCtrl:
    >
    > self.text_ctrl_4 = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE)
    > sizer_1.Add(self.text_ctrl_4, 6, wx.LEFT|wx.RIGHT|wx.EXPAND, 80)
    > self.text_ctrl_4.AppendText(str(count) + '\t\t' + str(address) + '\t\t'
    > + str(pageNumber) + '\t\t' + str(pageArray[pageNumber, 1]) +'\r\n')
    >
    > I'm wanting to implement something similar with a listbox, any thoughts?


    Well, my *first* thought was "Isn't a listbox supposed to allow choice
    between alternative? How can that substitute for what looks like a very
    complex text input?"

    My second thought was "It's not very helpful to use a name like
    'text_ctrl_4' in the code".

    I'm also not really sure what the double-tabs are supposed to do.

    Perhaps you could explain exactly what you'd like your program to do
    here, as at present it's not even clear whether this code is intended to
    act as input as well as output? What's wrong with what happens now, and
    how would you like to change it?

    regards
    Steve
    --
    Steve Holden http://www.holdenweb.com/
    Python Web Programming http://pydish.holdenweb.com/
    Holden Web LLC +1 703 861 4237 +1 800 494 3119
     
    Steve Holden, Dec 27, 2004
    #2
    1. Advertising

  3. LutherRevisited

    M.E.Farmer Guest

    I think he is using an GUI editor wxGlade or BOA.
    He has two problems he is trying to figure out wxPython
    and he is trying to figure out his drag and drop editor.
    On top of that he seems to be having a design problem.
    I am gonna let him stew in it, it will be good for him ;)
    He will get more out of it.
    hint: SEARCH GOOGLE / READ DOCS / WRITE CODE
    Ahh the joy of learning frameworks.(and GUI editors)
    M.E.Farmer
     
    M.E.Farmer, Dec 28, 2004
    #3
  4. LutherRevisited

    John Machin Guest

    M.E.Farmer wrote:
    > I think he is using an GUI editor wxGlade or BOA.
    > He has two problems he is trying to figure out wxPython
    > and he is trying to figure out his drag and drop editor.
    > On top of that he seems to be having a design problem.
    > I am gonna let him stew in it, it will be good for him ;)
    > He will get more out of it.
    > hint: SEARCH GOOGLE / READ DOCS / WRITE CODE
    > Ahh the joy of learning frameworks.(and GUI editors)
    > M.E.Farmer


    No, 4 problems:

    """wxpython.org's onlinedocs are down right now so bear with me""" =>
    hasn't downloaded the off-line docs.

    Typing in "wxlistbox" on the index tab of the win32 version of the
    off-line docs (wx.chm) takes one straight to:

    """wxListBox
    A listbox is used to select one or more of a list of strings.
    """
    i.e. Steve Holden's point, that wxListBox seems an unlikely choice.

    I generally tend to agree with the "let him stew" but inevitably
    someone will answer the question with a level of tedious detail
    exceeded only by that of the manual for the Holy Grenade of Antioch,
    instead of showing/telling the newbies how to find their own answers.
     
    John Machin, Dec 28, 2004
    #4
  5. This was the aforementioned doublepost guys, thanks for all the help though.
    At that point I was using WxGlade if you were wondering, that's why my controls
    have such funny names, glade did it!..lol I've since then got my gui to a
    point where I can live with it, other than the sizing problem when a scroll bar
    appears, don't believe that will ever be satisfactorily solved. You can either
    make everything fit perfectly, then it no longer fits when the vertical scroll
    appears causing you to need a horizontal scroll bar, or have it not fit as well
    to accomodate the horizontal scroll, or write a function to resize your columns
    appropriately when needed. None of those solutions is very appealing visually
    to me, so I'm just gonna let that one slide. Now if there's a "plan B" on
    resizing columns in a listctrl somebody tell me, because I can't think of any
    other way.
     
    LutherRevisited, Dec 28, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. LutherRevisited

    WxListBox

    LutherRevisited, Dec 26, 2004, in forum: Python
    Replies:
    0
    Views:
    430
    LutherRevisited
    Dec 26, 2004
  2. ishtar
    Replies:
    1
    Views:
    294
    isthar
    Nov 21, 2005
Loading...

Share This Page