From: <cha...@il...> - 2006-12-05 07:25:19
|
I'm having some problems with XRC and virtual ListCtrls. I followed the directions at http://wxperl.pvoice.org/kwiki/index.cgi?SubclassingXRC to create a subclass of a wxListCtrl. In order to pass it more data I created a simple init procedure that looks something like this: sub MyInit { my $self = shift; my $in = shift; $self->InsertColumn(0,"Column 1",wxLIST_FORMAT_LEFT, -1); $self->InsertColumn(1,"Column 2",wxLIST_FORMAT_LEFT, -1); $self->SetItemCount(15); $self->{data} = $in; } After I load the XRC file, I use findwindow to find the ListCtrl, then I call the above member function. The problem is that the data doesn't seem to stay with the object. The SetItemCount and InsertColumn work, but $self has nothing in it when OnGetItemText is called later. I tried the same pattern with another contol (TextCtrl) and that seemed to work. Can anyone help me with this problem? I'm using the binary downloads from the wxperl main page, I've tried it both on Mac OSX (10.4) and Windows XP Charlie |