Thank you, Stefan, for the thorough answer, and the investment of time and energy. Your post is really helpful. The program, the way you tweaked it, works fine.
And many thanks to kcott and the other Anonymous Monks who pitched in and responded.
Following up: Stefan and Monks, I'll be thankful to you if you could help me with the following questions (apologizing beforehand if some of them are quasi-newbie's):
- If you examine the Python code example, http://www.blog.pythonlibrary.org/2011/01/04/wxpython-wx-listctrl-tips-and-tricks/, see the lines:
self.index = 0
self.list_ctrl = wx.ListCtrl(panel, size=(-1,100),
style=wx.LC_REPORT |wx.BORDER_SUNKEN
)
Then for self.index = 0 we port it to Perl by declaring a new variable: my $idx =0; So, to port the second line, why not declare a new variable: my $list_ctrl; ? - and what kind of object is $self->{list_ctrl} ? Is it a reference to an anonymous hash? and where is list_ctrl now defined?
- When do you use &Wx::wxLC_SOMETHING, and when just: wxLC_SOMETHING? I notice that you haven't changed it everywhere, but left in some of the subroutine calls?
- I notice that you did not include the lines:
$self->{list_ctrl}->SetStringItem($idx, 1, '01/19/2010');
$self->{list_ctrl}->SetStringItem($idx, 2, 'USA');
If I do include them, compilation fails with: Can't locate object method "SetStringItem" via package "Wx::Perl::ListCtrl" at Wx List Control test v2.pl line 69.
How to overcome this? In other words, how do you modify/ insert strings in a ListCTRL line? - Looking ahead, the next necessary step for me, is to "tie" a database table to the Wx List Control, so that when the user scrolls at the GUI window, the application keeps retrieving database table lines (records) and displays them at the window.
Is there a way to "tie" an RDBMS table to a Wx List Control?
Thanks again for your thorough help - Helen
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.