Le Sun, 20 Sep 2015 21:01:21 +0200, Moviga Technologies  
<mov...@mykolab.ch> a écrit:

>
> Haha! Wow! I must have been to dizzy yesterday :) Sorry about that!
>
> But, then - why isn't this working:
>
> cbxProfile.Add(MGlobal.DEFAULTSTR) 'This works
> cbxProfile.List.Insert(MGlobal.Profiles) 'This adds nothing, even though
> the array contains entries.
>
> The code is already in FConfig as you can see, but is also supposed to
> be run inside FQuick.Init()
>

That's because the ComboBox's List property returns a copy of what's in it,
so modifying the array has no effect. You have to actually *set* the  
property
to an array in order to change the contents.

Therefore, this :

   cbxProfile.Clear()
   cbxProfile.Add(MGlobal.DEFAULTSTR)
   cbxProfile.List.Insert(MGlobal.Profiles)

... becomes this :

   cbxProfile.List = [MGlobal.DEFAULTSTR].Insert(MGlobal.Profiles)

And there it works. :)

I agree that you can't really guess it, so I added it in the  
documentation[0].

[0] http://gambaswiki.org/wiki/comp/gb.qt4/combobox/list
-- 
Adrien Prokopowicz

------------------------------------------------------------------------------
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to