Re: List Change Event (Expected Behavior)
- Posted by cklester <cklester at yahoo.com> Aug 25, 2004
- 410 views
Here's how I'd like it to work... -- code generated by Win32Lib IDE v0.18.20 include Win32lib.ew without warning -------------------------------------------------------------------------------- -- Window Window1 constant Window1 = createEx( Window, "Window1", 0, Default, Default, 167, 195, 0, 0 ) constant List2 = createEx( List, "List2", Window1, 4, 4, 148, 120, 0, 0 ) constant bttn_AddItem = createEx( PushButton, "Add Item", Window1, 36, 132, 88, 28, 0, 0 ) --------------------------------------------------------- -------------------------------------------------------------------------------- procedure List2_onChange (integer self, integer event, sequence params)--params is () setIndex(List2,getCount(List2)) setIndex(List2,0) --<-- so there's no highlight (forgot this in last sample) setFocus(bttn_AddItem) end procedure setHandler( List2, w32HChange, routine_id("List2_onChange")) -------------------------------------------------------------------------------- procedure bttn_AddItem_onClick (integer self, integer event, sequence params)--params is () addItem(List2,sprintf("%d - This should be visible on list",getCount(List2)+1)) List2_onChange(0,0,{}) -- should work without this call! (?) end procedure setHandler( bttn_AddItem, w32HClick, routine_id("bttn_AddItem_onClick")) WinMain( Window1,Normal ) -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/