LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

InsertListItem() works slower if the number of lines increase

Hello,

 

i am using a listbox to trace can/lin messages. I think that it is better to work with a textbox, but first i want to look, if there is a possibility to make the ui update faster. The item label is used to show the important data, the item value contains detailed information in a string.

 

Is it possible to grab the raw data of a listbox or to insert more than one item (label+value) without an ui update?

 

Is it possible to mark a row in a textbox like in a listbox? I need this option, to show detailed informations of a marked listbox entry a in second textbox.

 

Best regards,

Vitali

 

0 Kudos
Message 1 of 4
(3,375 Views)

Let's start from the second question. A row in a textbox cannot be "marked": you can detect which row the cursor is on by using ATTR_TEXT_SELECTION_START control attribute (but you will have to handle the case when the user selects more lines) and you can replace it prepending for example an asterisk (remember to delete it when you don't need it anymore).

 

On the listbox size, I suppose some improvement can be obtained by hiding the control while updating (be sure the listbox is not the active control and no screen refresh happens so that you don't see flickering).

Regarding the performance, while the text (item label) is always on screen you may consider that additional informations are not so crucial to maintain them inside the control all the time. That is, you could use the item value as the index into an in-memory object or a disk file where additional informations are stored: you can retrieve and display one single element when the user asks for it, leaving the control with a reduced amount of informations stored in it. It seems to me that this could make the control lighter and possibly reduce the slowering effect you are seeing now.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(3,367 Views)

Thank you for your help. I will try to save the additional information in the heap in an dynamic array.

0 Kudos
Message 3 of 4
(3,362 Views)

It does not help. I think i have to use a textbox instead of the listbox. I can not hide the control all the time, because the data will be read and displayed all the time. I try to insert several lines in the textbox with "SetCtrlAttribute" in one cycle. Hope this will work with a better performance.

0 Kudos
Message 4 of 4
(3,342 Views)