Re: [GtkcList] How to get data from a selected row?

From: Date: Mon, 17 Nov 2003 20:17:58 +0000
Subject: Re: [GtkcList] How to get data from a selected row?
References: 1 2 3  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-4170@lists.php.net to get a copy of this message
      Hi,
You can use this code to walk through selected items of GtkCList widget : ... foreach ( $clistFiles->selection as $key => $val) { $strFirstCellText = $clistFiles->get_text( $val, 0); $strSecondCellText = $clistFiles->get_text( $val, 1); ... etc ... } ... The same way you can get the selected rows from GtkCTree widget. The GtkCList::selection is strange and undocumented property - I mean that the documentation of GtkCList ( both of documentations -> php-gtk and gnome) didn't specify it. But in php-gtk documentation you can find it in GtkList's page... It's strange because of two reasons : 1: The gnome doc page about GtkList didn't specify this property. 2: GtkList is not in list of parent objects of GtkCList ... But if you what to walk through a list without selected items or just want to scan all items of the list, you have to use code like this : ... $i = 0; while ( "" != ( $strFirstCellText = $clistFiles->get_text( $i, 0))) { $strSecondCellText = $clistFiles->get_text( $i, 1); ... etc ... $i++; } ... To avoid unexpected interruption of scaning, always insure that you have a text in first column ( or column that you scan) and put " " (or another char) instead of ""... regards, Radko Andy wrote:
assuming the followiong example: $text = get_text(1,0); i can retrieve the text of the first row (column 0), but in what mode this function works for the 'current selected row'? get_row is not documented very well thank u Andy "Radko Sharkov" <radkosharkov@rodopi.com> ha scritto nel messaggio news:3FB92591.1060003@rodopi.com...
             Hi,
If you want to get the text from a arbitrary cell you should to use :
          ->get_text( $nRowNumber, $nColumnNumber)       -    method
of GtkCList object
      Both - $nRowNumber and $nColumnNumber are 0 based !!!
If you want to get the additonal data from a row you shold to use :
           ->get_data()   -   method derived from GtkObject class
regards, Radko Andy wrote:
I must write a function to retrieve the data of a selected row in a
     
gtkclist
widget. Thanks for all Andy
     


« previous php.gtk.general (#4170) next »