Currently I am doing a program which constantly reads and displays values captured by a device, which is connected thru the serial port. The values are displayed in my 3 text widgets(base_text1, base_text2, base_text3). I want to clear the contents in the 3 text widgets when a button is pressed. So I created a button and attached a callback called “reset” to it. Do I use the command PtFlush to clear the contents in my 3 text widgets? If so how do I use it? Attached is my callback function.
Thanks in advance!
int reset (PtWidget_t *widget, Apinfo_t *apinfo, PtCallbackInfo_t *cbinfo)
{
PtFlush();
The code you provided me, didn’t really work. When the reset button is pressed, the values in the text widgets flashed 0.0(empty_text was set as 0.0) and immediately restored back to the value they were previously displaying. What I intend to do is that the values 0.0 are permanently displayed on the text widget. Only when another start button is pressed then will the serial port open and continue to read and display the values.
I tried another way which was to close the comm port and then display 0.0 which didn’t work. What is wrong with it? Could anyone help?