LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Performance in updating of textbox

Solved!
Go to solution

Hello,

my name is Mirko and I'm making an application with CVI.

My application consists in updating the content inside a textbox.

Information to be inserted inside textbox are very fast, but using SetCtrlAttribute instead of SetCtrlVal, the speed is very good.

Performance of app is OK, but I see that when I click on textbox, performance goes down; if I click again on other item out of textbox, performance goes up.

I tried in debug and release, but it doesn't change.

 

My application doesn't require to write anything (it is "indicator").

Is there any parameter I can adjust in order to have always a good performance ?

 

Sorry if my explanation is not so clear...

 

Thanks in advance

 

Mirko

0 Kudos
Message 1 of 4
(1,575 Views)

try to update the text box from & separate thread

0 Kudos
Message 2 of 4
(1,568 Views)
Solution
Accepted by topic author mirkotacconi

Setting the UI object to indicator has no effect in this case since the user can always select the control and manipulate it someway (e.g. in order to select and copy the text inside).

In order to prevent this scenario you can install this as the textbox callback:

 

 

//--------------------------------------------------------------------------
//
// Function rejectFocus ()
//
//--------------------------------------------------------------------------
/// HIFN rejectFocus()
/// HIFN This function makes the user unable to click on the control
/// HIFN and select the text inside it
/// HIFN This function can be installed either inside the UI editor 
/// HIFN or by calling InstallCtrlCallback
/// HIFN Standard parameters of a control callback
int CVIFUNC_C rejectFocus (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2)
{
	switch (event) {
		case EVENT_COMMIT:
		case EVENT_RIGHT_CLICK:
		case EVENT_LEFT_CLICK:
			return 1;    // Swallow the events
		default:
			break;
	}

	return 1;
}

 

 



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?
Message 3 of 4
(1,557 Views)

Thanks Roberto, it works!

0 Kudos
Message 4 of 4
(1,539 Views)