Win32Lib: Possible problem with eraseItems() against a tree view?

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

Derek,

Using the attached example, first click the "Load a lot" button.  250 
tree view items should be loaded.  Then click the "Load a few" button to 
load 1 item.  eraseItems() is called to clear the tree view before 
loading the single item is added and the clear time is extremely long.  
The scroll bar changes height so you can tell something is happening.

I found this condition with win32lib v0.58.8 and v0.59.0.  I'm using IDE 
v0.17.0 on a Win2K Pro machine.

Thanks,

Jonas

--  code generated by Win32Lib IDE v0.17.0

 
include Win32Lib.ew
without warning

--------------------------------------------------------------------------------

--  Window Window1
global constant Window1 = createEx( Window, "Test tree view clearing", 
0, Default, Default, 516, 462, {WS_DLGFRAME, WS_SYSMENU}, 
{WS_EX_DLGMODALFRAME} )
global constant TreeView2 = createEx( TreeView, "", Window1, 16, 76, 
480, 328, 
or_all({TVS_HASLINES,TVS_LINESATROOT,TVS_HASBUTTONS,TVS_SHOWSELALWAYS}), 
0 )
constant closefolder = addIcon( extractIcon("clsdfold.ico") )
constant openfolder  = addIcon( extractIcon("openfold.ico") )
global constant LoadFew = createEx( PushButton, "Load a few", Window1, 
28, 28, 88, 28, 0, 0 )
global constant LoadLot = createEx( PushButton, "Load a lot", Window1, 
132, 28, 88, 28, 0, 0 )
global constant Exit = createEx( PushButton, "Exit", Window1, 240, 28, 
88, 28, 0, 0 )
---------------------------------------------------------
--------------------------------------------------------------------------------

procedure LoadFew_onClick (integer self, integer event, sequence 
params)--params is ()
	atom void
	eraseItems(TreeView2)
	void = addTVItem(TreeView2, 0, 0, "One item", 0)
end procedure
setHandler( LoadFew, w32HClick, routine_id("LoadFew_onClick"))
--------------------------------------------------------------------------------

procedure LoadLot_onClick (integer self, integer event, sequence 
params)--params is ()
	atom void
	eraseItems(TreeView2)
	for i = 1 to 250 do
		void = addTVItem(TreeView2, 0, 0, sprintf("%d",i), 0)
	end for
end procedure
setHandler( LoadLot, w32HClick, routine_id("LoadLot_onClick"))
--------------------------------------------------------------------------------

procedure Exit_onClick (integer self, integer event, sequence 
params)--params is ()
	closeWindow(Window1)
end procedure
setHandler( Exit, w32HClick, routine_id("Exit_onClick"))


WinMain( Window1,Normal )

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

Search



Quick Links

User menu

Not signed in.

Misc Menu