SETTVTEXT bug and Fix

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

Hi Derek,

I found out there was a bug in win32libs setTVText(). Apparently
the text only changed when the treeview would receive the next 
TVN_GETDISPINFO
message. Below is a fix that forces it to change without having to
wait for the TVN_GETDISPINFO message.


global procedure setTVText( integer iItem, sequence pNewText )
-- Start Jordah Ferguson
atom TV_ITEM
-- End Jordah Fergusom
    if iItem > 0 and iItem <= length(tvitem_data) then
        release_mem(tvitem_data[iItem][ktv_TextAddr])
        tvitem_data[iItem][ktv_TextAddr] = acquire_mem(0, pNewText )
        tvitem_data[iItem][ktv_TextSize] = length(pNewText)
-- Start Jordah Ferguson
TV_ITEM = struct_TVITEM( TVIF_TEXT, tvitem_handle[iItem], 0, 0, "", 0, 
0, 0, iItem)
VOID    = sendMessage(tvitem_owner[iItem], TVM_SETITEM, 0, TV_ITEM ) 
-- End Jordah Ferguson
    end if
end procedure


Happy coding(should be debugging) and Success to Win32lib!
Cheers,
Jordah Ferguson aka Sir LoJik

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

Search



Quick Links

User menu

Not signed in.

Misc Menu