Trouble with wxListCtrl

Mel Wilson mwilson at the-wire.com
Mon Sep 22 15:00:58 EDT 2003


In article <49c4d036.0309220953.29b6fd1e at posting.google.com>,
pkbf-tspx at dea.spamcon.org (chauhan) wrote:
>I have written a small program which retrieves emails from server,
>unless all the messages are loaded only then it displays on screen
>properlely. Whole thing works fine if I use events to activate
>logMail() after start but I don't know how to activate an event at the
>start (witout pressing mouse  or  menu key) as I want this to load
>messages at the start of the program.

   Typically, at the end of main_window.__init__ or
App.OnInit, just go through the steps that you would go
through on an event.  Although I'm not familiar with poplib
and the complications that it might introduce.

>I am also having problem with statement
>self.list.GetItemText(self.currentItem). The statement
>self.currentItem gives the current selected item position on listctrl
>this statement works fine in wxPanel (demo example wxlistctrl in
>wxPython) and not with
>wxFrame which I am using now as I want menubar in my application. Can
>some body tell me how to get the current selected items position in
>wxListCtrl with wxFrame? Same kind of problem with wxPoint(self.x,
>self.y) but I can use wxGetMousePosition().

   According to the docs, this is true.  What you should do
is put a Panel in the Frame, and put the ListCtrl in the
Panel.  I haven't tested this, but something like:


        tID = wxNewId()
        list_panel = wxPanel (splitter, -1)
        self.list = wxListCtrl (list_panel, tID,
                        style=wxLC_REPORT|wxSUNKEN_BORDER|wxLC_SINGLE_SEL)
...
        splitter.SplitHorizontally (list_panel, self.log, 450)


might work.

        Good Luck.      Mel.




More information about the Python-list mailing list