Touble clearing GtkComboBoxEntry text list
| From: | Bernard Fouché | Date: | Thu, 26 Jul 2007 14:43:59 +0000 |
| Subject: | Touble clearing GtkComboBoxEntry text list | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-7996@lists.php.net to get a copy of this message | ||
Hi List.
Yet another newbie question! I'm now building a list of choices in a GtkComboxEntry widget. These choices are calculated on the fly.
First time setting them thru $this->Widget->insert_text() is no problem. Then I want to clear the list of choices and make a new one.
Currently, I use:
$pos=50;
while($pos>0)
$this->Widget->remove_text($pos--);
Instead of:
$this->Widget->clear(); // This will clear all entries and ignore calls to insert_text()!
Then I build the entries:
$this->Widget->insert_text(0,"No target selected yet.");
$pos=1;
foreach($Targets as $key => $val)
$this->Widget->insert_text($pos++,$val);
$this->Widget->set_active(0);
If I call clear() before inserting text entries, the list stays empty, even if calls to insert_text() are done. I don't know how I can count entries, hence I use the value '50' for manual clearing with remove_text(), something I don't like ('50' is totally arbitrary).
What did I miss this time?
Thanks!
Bernard