Re: selected from a GtkCList

From: Date: Sat, 25 Oct 2003 00:33:14 +0000
Subject: Re: selected from a GtkCList
References: 1 2  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-4002@lists.php.net to get a copy of this message
Hi Lluís, 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 Lluís Forns Puigmartí wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 how do I get the selected rows of a GtkCList? I want to make a program to check ziped files from a directori, and then list which of them are ok and which ones corrupted. I put in the files in a GtkCList (already done) and then I want to check the selected ones. thanks -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/mX0scGPBNmHtv7ARAtIWAJwIE+oO9oYTKtpWoRGGKnUeYIlj/wCeO+gV yacFplA+MzmZ5oPa6zzqhvE= =Huh6 -----END PGP SIGNATURE-----


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