ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-gtk-general
php-gtk-general
[PHP-GTK] Touble clearing GtkComboBoxEntry text list
by Bernard Fouche other posts by this author
Jul 26 2007 7:44AM messages near this date
Re: [PHP-GTK] Help with treeview | Re: [PHP-GTK] Touble clearing GtkComboBoxEntry text list
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
Thread:
Bernard Fouche
Kksou
Kksou
Bernard Fouche
Kksou
Bernard Fouche

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved