« Return to Thread: Touble clearing GtkComboBoxEntry text list

Touble clearing GtkComboBoxEntry text list

by Bernard Fouché :: Rate this Message:

Reply to Author | View in Thread

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

--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

 « Return to Thread: Touble clearing GtkComboBoxEntry text list