Win32Lib 0.57.1 onChange bug (test code)

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

Here is the test program I'm working with.  It is interesting to note 
that the 'onChange' event seems to be working OK while you are typing in 
a new entry into the Combo box but is reporting the previous value when 
selecting items.

------------------------------------
include win32lib_full.ew
without warning

constant
   Win = create(Window,"test",0,Default,Default,200,200,0),
   Cmbo = create(Combo,"",Win,10,10,100,100,0),
   Stat = create(StatusBar,"",Win,0,0,0,0,0),
   Btn  = create(DefPushButton,"Enter",Win,130,10,40,20,0)
  
procedure onClick_Btn()
  sequence ctxt

  ctxt = getText(Cmbo)
  if length(ctxt) then
     addItem(Cmbo,ctxt)
  end if
end procedure
onClick[Btn] = routine_id("onClick_Btn")

procedure onChange_Cmbo()
   --doEvents(Win)
   setText(Stat,getText(Cmbo))
end procedure
onChange[Cmbo] = routine_id("onChange_Cmbo")

procedure onOpen_Win()
   addItem( Cmbo, {"Oranges", "Pears", "Bananas", "Mangoes" } )
end procedure
onOpen[Win] = routine_id("onOpen_Win")
  
WinMain(Win,Normal)
------------------------------------

-- Brian


Brian Broker wrote:
> Hi Mike,
> 
> I don't know if anybody else is investigating this issue but I'm doing 
> what I can to figure out what is going on.
> 
> All I can see is that the onChange is being processed before the text is 
> 
> actually changed in the control.  Adding a "doEvents(Win)" at the 
> beginning of my onChange routine does not change the behavior.
> 
> If anybody else is investigating, let us know what you have discovered.  
> 
> I'd rather not waste time on a known issue.
> 
> Thanks,
> Brian
> 
> Michael wrote:
> > Upgraded from version 0.45r
> > Control type: SortedCombo
> > Symptom:
> >   When selecting an item from the dropdown, key = getText(comboControl)
> > is called to get the new value of the dropdown.  However, getText
> > returns the prior value of comboControl, which is only updated after the
> > onChange routine (which contains the call to getText) is executed.  I
> > cannot tell where in the new version of win32lib this behavior is being
> > applied.  It works fine under 0.45r.  Any suggestions?
> > 
> > Michael J. Sabal
> > 
> >

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

Search



Quick Links

User menu

Not signed in.

Misc Menu