[wxPython] wxListCtrl

I posted the question over a week ago, but no responses. Here I go again.

···

--
I'm trying to get the below code to work. I need to use wxLC_USER_TEXT, but
the event doesn't seem to work. The items show up in the list, but no text.
Thanks.

from wxPython.wx import *
class MyFrame ( wxFrame ):
    def __init__ ( self, parent ):
        wxFrame.__init__( self, parent, 1, 'Test', size = (200, 300) )
        self.list = wxListCtrl( self, 2,
style=wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_USER_TEXT )
        self.list.InsertColumn( 0, 'Hi' )
        for i in range( 10 ):
            self.list.InsertStringItem( i, 'hi' )
        EVT_LIST_GET_INFO(self.list,2,self.OnListInfo)
        self.Center()
        self.Show( true )
    def OnListInfo( self, event ):
        item = event.GetItem()
        item.m_text = 'hi'
class MyApp ( wxApp ):
    def OnInit ( self ):
        self.frame = MyFrame( None )
        self.SetTopWindow( self.frame )
        self.frame.Raise()
        return true
def run():
    app = MyApp( 0 )
    app.MainLoop()
    del app
if __name__ == "__main__":
    run()

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

I'm trying to get the below code to work. I need to use wxLC_USER_TEXT,

but

the event doesn't seem to work. The items show up in the list, but no

text.

Thanks.

The code to generate the event is ifdef'ed out:

        case LVN_GETDISPINFO:
                // this provokes stack overflow: indeed,
wxConvertFromMSWListItem()
                // sends us WM_NOTIFY! As it doesn't do anything for now,
just leave
                // it out.
#if 0
            {
                // TODO: some text buffering here, I think
                // TODO: API for getting Windows to retrieve values
                // on demand.
                eventType = wxEVT_COMMAND_LIST_GET_INFO;
                LV_DISPINFO *info = (LV_DISPINFO *)lParam;
                wxConvertFromMSWListItem(this, event.m_item, info->item,
GetHwnd());
                break;
            }
#endif // 0
                return FALSE;

You can probably get more info and a prognosis from wx-users or wx-devel.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

Ah. Bummer. As I don't have the time right now I can't pursue this further.
Would've been great to have been able to do this. Thanks.

···

----- Original Message -----
From: "Robin Dunn" <robin@alldunn.com>
To: <wxpython-users@lists.sourceforge.net>
Sent: Wednesday, February 07, 2001 6:28 PM

The code to generate the event is ifdef'ed out:

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users