LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatically setting value of toggle button?

Solved!
Go to solution

Is this not possible? I've looked at the help for both SetCtrlVal() and SetCtrlAttribute(), and it doesn't look like it can be done. True?

 

My app has a control button to clear the displayed graph. It would be nice if the function's first action were to set the value of a toggle button to "OFF." Any other way of accomplishing this?

 

Thanks.

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

Why do you think that ATTR_CTRL_VAL does not work? It does...

0 Kudos
Message 2 of 4
(3,438 Views)

Well, then I must be forming the call incorrectly. I couldn't find an example using ATTR_CTRL_VAL, so I wrote this:

 

rc = SetCtrlVal (g_hmainPanel, PANEL_MAIN_TOGGLEBUTTON, ATTR_CTRL_VAL, 0);

 And I get the run-time error:

 

NON-FATAL RUN-TIME ERROR:   "cleargraph.c", line 30, col 84, thread id 0x00002EE8:   Too many arguments to variable argument function.

 So, if the ATTR_CTRL_VAL form of the call doesn't accept any more arguments, how do I inform the command of the state I wish to put the control into?

 

Thanks.

 

0 Kudos
Message 3 of 4
(3,433 Views)
Solution
Accepted by topic author mzimmers

Smiley Indifferent

 

SetCtrlAttribute (,, ATTR_CTRL_VAL, 0);

 

or

 

SetCtrlVal  (, , 0);

 

works for me.

Message 4 of 4
(3,430 Views)