Win32Lib - Updating Interface with Click on TV
- Posted by euphoric (admin) Apr 12, 2010
- 1368 views
When clicking on the TreeView in the following program, the label text should be updated with the currently selected TV item. However, it always lags behind one. I'm sure I'm doing something stupid... but what? :/
-- code generated by Win32Lib IDE v0.19.1 include Win32lib.ew without warning -------------------------------------------------------------------------------- -- Window Window1 constant Window1 = createEx( Window, "Window1", 0, Default, Default, 400, 300, 0, 0 ) constant TreeView2 = createEx( TreeView, "TreeView2", Window1, 8, 12, 208, 200, w32or_all({TVS_HASLINES,TVS_LINESATROOT,TVS_HASBUTTONS,TVS_SHOWSELALWAYS}), 0 ) constant closefolder = addIcon( extractIcon("clsdfold.ico") ) constant openfolder = addIcon( extractIcon("openfold.ico") ) constant LText3 = createEx( LText, "LText3", Window1, 228, 80, 148, 20, 0, 0 ) --------------------------------------------------------- -------------------------------------------------------------------------------- procedure Window1_onActivate (integer self, integer event, sequence params)--params is () atom rent rent = addTVItem( TreeView2, 0, 0, "Momma", 0 ) for t=1 to 10 do VOID = addTVItem( TreeView2, 0, 0, "Item #" & sprint(t),rent) end for end procedure setHandler( Window1, w32HActivate, routine_id("Window1_onActivate")) -------------------------------------------------------------------------------- procedure TreeView2_onClick (integer self, integer event, sequence params)--params is () setText( LText3, getTVSelectedText( self ) ) end procedure setHandler( TreeView2, w32HClick, routine_id("TreeView2_onClick")) WinMain( Window1,Normal )