Re: Bug getText

new topic     » goto parent     » topic index » view thread      » older message » newer message

Dan-Åke Engqvist wrote:
> 
> I have written a small test program with Judith Evans IDE v1.0.0 and
> Win32lib v0.60.6
> There is Combo2, Combo5 and EditText4.
> When Combo2 is changed then EditText4 should get the text from Combo5.
> Now if I print David in Combo5 and select Bert in Combo2, then EditText4
> becomes blank (bug?).
> If I write something in Combo2 then EditText4 get the text from Combo5 (ok!)
> 
>
> --------------------------------------------------------------------------------
> addItem(Combo2,{"Adam","Bert","Charles"})
> setIndex(Combo2,1)
> addItem(Combo5,{"Dan","Evelyn","Philip"})
> setIndex(Combo5,1)
> 
>
> --------------------------------------------------------------------------------
> procedure Combo2_onChange (integer self, integer event, sequence
> params)--params
> is ()
> setText(EditText4,getText(Combo5))
> end procedure
> setHandler( Combo2, w32HChange, routine_id("Combo2_onChange"))
> 
> Dan-Åke Engqvist
Hi

This isn't a bug so much as a change of concept when using a Combo.  The Combo
is a combination of an EditText and a List.  So when you want to get the text
from the EditText you need to ask what its control id is.

ie (in your onChange)

     setText(EditText4,getText(getEdit(Combo5)))

getEdit() is described (in the documentation I have, also 0.60.6) in the
"Controls" section.  It isn't mentioned anywhere in the "List Control" section
though, so I can understand the confusion.

Gary

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu