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

Rafael Teixeira monoman at gmail.com
Mon Jul 25 11:08:46 EDT 2005


Well the naming follows Gtk, so that you can reuse Gtk+ documentation
and skills.

But surely we have here a situation where a clearer name like
NumberOfChildren or CountOfChildren would be a better choice, as Iter
is implied by the class (in Gtk+ which in written in C it wasn't) so
it isn't a needed prefix and N is too short and really doesn't convey
a real meaning for people coming from Windows (VB6/ActiveX) or using
the Base Class Library. In practical terms I would create some
"semantical" overloads for those methods/properties that are such
rooted Gtk-isms.

I'll comment another facet in my answer to Todd's post also in this thread. 

On 7/24/05, John BouAntoun <jbouantoun at rogen.com.au> wrote:
> That brings up a good point.
> 
> Not sure if this is still the case, but why in today's day and age (of C# and other great managed languages) is someone using IterNChildrend() (a strangely named function) to return a property that would be most obviously named Count (as with most other collections)?
> 
> This was one thing that made learning the tree/list-store workings almost impossible for me in C#.
> 
> JBA
> 
> -----Original Message-----
> From: mono-devel-list-bounces at lists.ximian.com [mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Rafael Teixeira
> Sent: Saturday, 23 July 2005 3:25 AM
> To: Hubert FONGARNAND
> Cc: mono-devel-list at lists.ximian.com
> Subject: Re: [Mono-devel-list] gtk ComboBox questions...
> 
> Stop Nonsense!!!
> 
> Hubert, Just call the proper method:
> 
> int count = myComboBox.Model.IterNChildren();
> 
> :)
> 
> On 7/22/05, Hubert FONGARNAND <informatique.internet at fiducial.fr> wrote:
> >
> >
> > ----------  Message transmis  ----------
> >
> > Subject: Re: [Mono-devel-list] gtk ComboBox questions...
> > Date: Vendredi 22 Juillet 2005 14:14
> > From: Hubert FONGARNAND <informatique.internet at fiducial.fr>
> > To: Mikkel Kruse Johnsen <mikkel at linet.dk>
> >
> > Le Vendredi 22 Juillet 2005 12:35, vous avez écrit:
> > > 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/ <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;
> >
> > I cannot cast a treemodel into a tree store...
> > i got :
> > Unhandled Exception: System.InvalidCastException: Cannot cast from source
> >  type to destination type.
> > when i do :
> > TreeStore store=(TreeStore)drpCivilite.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
> > > <mailto:Mono-devel-list at lists.ximian.com>
> > >
> > > http://lists.ximian.com/mailman/listinfo/mono-devel-list
> > > <http://lists.ximian.com/mailman/listinfo/mono-devel-list>
> >
> > -------------------------------------------------------
> >
> > _______________________________________________
> > 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 immédiatement l'expéditeur. 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 sécurisées, l'intégrité de ce message n'est pas assurée et la société é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
> >
> 
> 
> --
> Rafael "Monoman" Teixeira
> ---------------------------------------
> I'm trying to become a "Rosh Gadol" before my own eyes.
> See http://www.joelonsoftware.com/items/2004/12/06.html for enlightment.
> It hurts!
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 
> 


-- 
Rafael "Monoman" Teixeira
---------------------------------------
I'm trying to become a "Rosh Gadol" before my own eyes. 
See http://www.joelonsoftware.com/items/2004/12/06.html for enlightment.
It hurts!



More information about the Mono-devel-list mailing list