08-17-2011 01:24 PM
I am calling SetCtrlAttribute(handle, ATTR_LABEL_TEXT, graphcontrolID, "arbitrary text"), but the text label on the graph control isn't getting updated. I tried calling ProcessDrawEvents(), but that doesn't help. How do I get the label to change?
Solved! Go to Solution.
08-17-2011 01:52 PM
the sequence of parameters is wrong in your example, it should read: SetCtrlAttribute ( panel_handle, control_id, ATTR_LABEL_TEXT, "label text" );
08-17-2011 01:54 PM
Should be:
SetCtrlAttribute (panelHandle, PANEL_CONTROL, ATTR_LABEL_TEXT, "arbitrary text");
08-17-2011 01:55 PM
Hi shpanda,
This is the definition of SetCtrlAttribute:
int SetCtrlAttribute (int panelHandle, int controlID, int controlAttribute, ...);
for example
SetCtrlAttribute (panelHandle, PANEL_Control, ATTR_LABEL_TEXT, "text");
It seems that you have first the controlAttribute than your controlID, try to change the other in this way:
SetCtrlAttribute(panelhandle, PANEL_graphcontrolID, ATTR_LABEL_TEXT, "arbitrary text")
Also make sure that the name of handle corresponds to the name of your panel.
Regards,
08-17-2011 02:00 PM
Oops. Thank you. Just a typo. That was easy!
07-31-2012 10:56 PM
SetCtrlAttribute()can't change the control value and display it immediately, when you use the SetCtrlAttribute function, the control will be updated after the dispaly function called, so if you want to chang a control value and display it immediately,you can use the SetCtrVal, this function can implement, but it will take a little long time.
GOOD LUCK