Hi there! I am working on a Gtk-Perl project, but I've just run into trouble. I have a CList and I want to set certain data on each of its rows, but I can't put this get_row_data() to work properly. Here's the code:

foreach (keys %{$dades->[0]}) { $feines[0] = $dades->[0]->{$_}->{'client_id'}; $feines[1] = $dades->[0]->{$_}->{'treb_id'}; $feines[2] = $dades->[0]->{$_}->{'zona_nom'}; $feines[3] = $dades->[0]->{$_}->{'feina_desc'}; $feines[4] = $dades->[0]->{$_}->{'feina_tipus'}; $feines[5] = $dades->[0]->{$_}->{'status'}; my $row = $form->{'feines'}->append(@feines); my $valor = $dades->[0]->{$_}->{'feina_id'}; my $tmp = $valor; # If I don't do this, then get_row_data returns an UNKNOWN ref + afterwards... weird $form->{'feines'}->set_row_data($row, $tmp); print "Fila $row, valor $tmp\n"; } [...] # $event contains the number of the CList row that has been selected, +let's say 1. $glob_rowid = $form->{'feines'}->get_row_data($event); print "Row $event; Data: $glob_rowid"; print Dumper $glob_rowid;

There. Now, let's have a look at STDOUT:

Fila 0, valor 2 Fila 1, valor 1 Fila 2, valor 3 Row 1; Data: SCALAR(0x8640110) $VAR1 = \undef;

Shouldn't this return $tmp? The fact that if I don't do $tmp = $valor gets me to an UNKNOWN ref looks a little bit strange to me... any ideas about *how* get_row_data and set_row_data should be used? (According to Stephen Wilhelm's tutorial, its use should be "self-explanatory"... oops ;P) Am I doing anything else wrong?

As always, any help will be greatly appreciated :)


$ touch tita
$ mv tita /dev/null
mv: cannot move `tita' to `/dev/null': Permission denied
... whoops ;P

In reply to Gtk-Perl $CList-get_row_data() problems by Lasker

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.