[Mono-devel-list] gtk ComboBox questions...

Mikkel Kruse Johnsen mikkel at linet.dk
Fri Jul 22 06:35:29 EDT 2005


Hi Hubert

The ComboBox is using a TreeModel to represent the rows. So look at
TreeModel (TreeStore or ListStore) for info.
http://www.go-mono.com/docs/

To clean up all entries in a combobox...:

    TreeStore store = (TreeStore)combo.Model;
    store.Clear();

Count the entries I don't know if there is a function for that, else you
have to loop through the rows like this:

			
    TreeStore model = (TreeStore)combo.Model;
    TreeIter iter   = new TreeIter();
    
    int count = 0;			
    bool res = model.GetIterFirst(out iter);
    while(res)  {
        count++;
        res = model.IterNext(ref iter);
    }

/Mikkel

On Fri, 2005-07-22 at 09:55 +0200, Hubert FONGARNAND wrote:

> I'm new to Gtk# and I can't find any help on MonoDoc with the ComboBox widget 
> (not the old Combo Widget)
> 
> Does someone know how to :
> Clean up all entries in a combobox...
> Count the number of entries in the combobox
> 
> thanks in advance...
> 
> _______________________________________________
> Ce message et les ventuels documents joints peuvent contenir des informations confidentielles.
> Au cas o il ne vous serait pas destin, nous vous remercions de bien vouloir le supprimer et en aviser immdiatement l'expditeur. Toute utilisation de ce message non conforme  sa destination, toute diffusion ou publication, totale ou partielle et quel qu'en soit le moyen est formellement interdite.
> Les communications sur internet n'tant pas scurises, l'intgrit de ce message n'est pas assure et la socit mettrice ne peut tre tenue pour responsable de son contenu.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050722/b2eb105b/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050722/b2eb105b/attachment.bin 


More information about the Mono-devel-list mailing list