note 621 added to gtk.gtkclist.method.remove.php
| From: | kasper at johansen dot tdcadsl dot dk | Date: | Sat, 11 Feb 2006 16:54:19 +0000 |
| Subject: | note 621 added to gtk.gtkclist.method.remove.php | ||
| Groups: | php.gtk.webmaster | ||
| Request: | Send a blank email to php-gtk-webmaster+get-2923@lists.php.net to get a copy of this message | ||
If you remove the item with the id "0", the next in the list (the one with the id
"1") will become "0".
You cannot make a foreach()-run on the clist selected and remove them this way.
The way to solve this problem is using array_reverse() (so you will run through the list backwards,
taking the largest numbers first):
<?
foreach(array_reverse($myclist -> selection) AS $value){
$myclist -> remove($value);
}
?>
http://gtk.php.net:80/manual/en/gtk.gtkclist.method.remove.php