XP is just a number | |
PerlMonks |
Re^3: wxPerl fails with a cryptic message: "variable is not of type Wx::Point"by stefbv (Curate) |
on Mar 09, 2013 at 12:10 UTC ( [id://1022560]=note: print w/replies, xml ) | Need Help?? |
I'm not very good at explaining things, but I'l try, wxLC_xREPORT, wxBORDER_SUNKEN,... are constant integers defined in the Wx package but not imported by default (for example wxLC_xREPORT == 32). After import you can use the short form. If a constant is not imported you can prepend the class name like this: Wx::wxLC_xREPORT. (I'm not sure about the '&'). I did not change everywhere because it was almost midnight and missed it, no other reason :) The sole purpose of the $idx variable is numbering in the label. It uses a closure , see Closure on Closures The $list_ctrl variable, in your version of the example, is the reference to the list control object. It is assigned once at the creation of the widget object. This object has methods to add columns and rows to the list, so we need to save it somewhere so we can use it later. One method is to use a hash reference to save it so i can refer to the list object later from other subs. Here is how to add data to columns, also using the shortcut form from Anonymous Monk - (thanks!)
What is interesting and unespected for me, is that item can be 0 and still adds rows, I was expectig to overwrite the first item. Stefan Update: Replaced '32' with 'wxLC_REPORT'. I was trying to show that wxLC_REPORT is just a constant, but the result was a wrong example. Also removed 'Wx::' from the other flag.
In Section
Seekers of Perl Wisdom
|
|