http://www.perlmonks.org?node_id=1025024

HelenCr has asked for the wisdom of the Perl Monks concerning the following question:

Dear esteemed PerlMonks

I am trying to port a wxPython ListControl example, into wxPerl. The problem: I don't get the column heading titles (or bar).

Here are the details:
Original Python code example, taken from: http://stackoverflow.com/questions/5648816/ (first answer):

import wx class MainWindow(wx.Frame): def __init__(self, *args, **kwargs): wx.Frame.__init__(self, *args, **kwargs) self.panel = wx.Panel(self) self.panel.SetBackgroundColour(wx.GREEN) self.list = wx.ListCtrl(self, style=wx.LC_REPORT, size=(200, - +1)) column_size = self.list.GetSize()[0] / 2 - 2 self.list.InsertColumn(0, 'Name') self.list.InsertColumn(1, 'Age') self.list.SetColumnWidth(0, column_size) self.list.SetColumnWidth(1, column_size) self.sizer = wx.BoxSizer() self.sizer.Add(self.list, proportion=0, flag=wx.EXPAND) self.sizer.Add(self.panel, proportion=1, flag=wx.EXPAND) self.SetSizerAndFit(self.sizer) self.SetSize((600, 400)) self.Show() app = wx.App(False) win = MainWindow(None) app.MainLoop()

My port into wxPerl:

use strict; use warnings; use Wx; use 5.014; use autodie; use Carp; use Carp qw {cluck}; use Carp::Always; use Win32::Console; package MainWindow; use Wx ':everything'; use parent -norequire, 'Wx::Frame'; sub new { #1 MainWindow:: my $class = shift; my $self = $class->SUPER::new( undef, -1, # parent window; ID -1 means any 'Test', # title [-1,-1 ], # position [ -1, -1 ], # size ); # def __init__(self, *args, **kwargs): # wx.Frame.__init__(self, *args, **kwargs) $self->{panel} = Wx::Panel->new($self); $self->{panel}->SetBackgroundColour(wxGREEN); $self->{list} = Wx::ListCtrl->new($self->{panel}, wxLC_REPORT, + [200, -1]); my $column_size = $self->{list}->GetSize->width / 2 - 2; $self->{list}->InsertColumn(0, 'Name'); $self->{list}->InsertColumn(1, 'Age'); $self->{list}->SetColumnWidth(0, $column_size); $self->{list}->SetColumnWidth(1, $column_size); $self->{sizer} = Wx::BoxSizer->new(wxVERTICAL); $self->{sizer}->Add($self->{list}, 0, wxEXPAND); $self->{sizer}->Add($self->{panel}, 1, wxEXPAND); $self->SetSizerAndFit($self->{sizer}); $self->SetSize([600, 400]); return $self; } #1 end sub new MainWindow:: my $app = Wx::SimpleApp->new; my $win = MainWindow->new; $win->Show(1); $app->MainLoop;

The problem: you do get a window, which does get resized, but I don't see any ListCtrl heading line (or bar), or any column titles.
Am I doing something wrong? Is there a mistake somewhere?
My system: DWIM Perl 5.14.2 on Windows 7.

Your help will be appreciated.

Many TIA - Helen