Skip to main content
Associate III
August 25, 2024
Question

Access line widget from own source file

  • August 25, 2024
  • 1 reply
  • 494 views

Hello, I am trying to modify the start and end points of a line I have created in TouchGFX from outside of the screen code generated by touchGFX.  I would like to be able to modify the end points from my own source code files by calling line1.setEnd(240, 240) or even creating a function inside of screen1view that would update the endpoints. 

Thanks for any suggestions!

1 reply

ST Employee
August 27, 2024

Hello @brohr01,

 

You just need to use setEnd and, do an invalidation before and after you :

void Screen1View::MyFunction()
{
 line1.invalidate(); // needed to mark the old area to invalidate
 line1.setEnd(newEndX, newEndY);
 line1.invalidate();
}

 

I hope it helps,
Best regards,