RE: [PHP-GTK] clist:get_row_data
| From: | Oliver Hotz | Date: | Mon, 29 Nov 2004 17:03:16 +0000 |
| Subject: | RE: [PHP-GTK] clist:get_row_data | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-5274@lists.php.net to get a copy of this message | ||
Got it working... that was exactly the problem.. I had just the
$row=$clist->append(...);
However, I never set the row data with the set_row_Data command... I thought
I could just query whats being appended.
Thanks for your help, its much appreciated.
Oliver
>But I realized that your code work well too... so maybe the fault is in
>the set_row_data ...
>
>When you add the row:
> $row=$clist->append(...);
>You must add your "row data" with this simple call:
> $clist->set_row_data($row,"thats my row data");
>
>Gonzalo Monzón.
Oliver Hotz
Digital Supervisor / Artist
http://www.oliverhotz.com
ICQ: 6174819
AIM: oliverhotz
-----Original Message-----
From: Gonzalo Monzón [mailto:gmc@serveisw3.net]
Sent: Monday, November 29, 2004 8:41 AM
To: php-gtk-general@lists.php.net
Subject: Re: [PHP-GTK] clist:get_row_data
Gonzalo Monzón wrote:
> Oliver Hotz wrote:
>
>> I just can't get it to work... this is what I have:
>>
>> function QueueSelectRow( $objPara1)
>> {
>> $row = $this->arWidgets["queueclist"]->selection[0]; // selected row
>> $rowdata = $this->arWidgets["queueclist"]->get_row_data($row);
>> var_dump($rowdata);
>> }
>>
>>
>>
>>
>> $row gets assigned correctly, its either 0 or 1, depending which of my 2
>> rows I select... however, $rowdata is always NULL :(
>>
>>
>> Oliver
>>
>>
>> -----Original Message-----
>> From: Alan Knowles [mailto:alan@akbkhome.com] Sent: Sunday, November
>> 28, 2004 10:28 PM
>> To: oliver@heimlich.net
>> Cc: php-gtk-general@lists.php.net
>> Subject: Re: [PHP-GTK] clist:get_row_data
>>
>> Cant remember all the tricks on this, probably just be carefull you
>> are using a reference to the row/list, rather than a copy (eg. =&
>> rather than =)
>>
>> http://docs.akbkhome.com/phpmole/module_directory_viewer.html
>>
>> look for set_row_data /get_row_data
>>
>> Regards
>> Alan
>>
>> Oliver Hotz wrote:
>>
>>
>>
>>> Is there anything special you need to do to make this work ?
>>>
>>> Doesn`t matter which row I query, my result is always NULL
>>>
>>> Thanks for any help
>>>
>>>
>>>
>>>
>>
>>
>>
>>
> Hi Oliver!
>
> I think your fault its that you're not getting the "$row" object, when
> you made your call :
>
> $row = $this->arWidgets["queueclist"]->selection[0]; // selected
> row
>
> the var $row it is just the num. of the sel. row... no the row object.
> ie. row 0, 3, 45 ...
>
> To get the "truly" row object you must change the declare of the
> callback function:
> (the callback already sends you the object ref. but you aren't using it!)
>
> function QueueSelectRow( $objPara1, $clist_row)
>
> Then if you call: $rowdata =
> $this->arWidgets["queueclist"]->get_row_data($clist_row);
> You will get the data you have previously fetch to the clist then
> added the row...
>
>
> Gonzalo Monzón.
>
But I realized that your code work well too... so maybe the fault is in
the set_row_data ...
When you add the row:
$row=$clist->append(...);
You must add your "row data" with this simple call:
$clist->set_row_data($row,"thats my row data");
Gonzalo Monzón.
--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php