cancel
Showing results for 
Search instead for 
Did you mean: 

Access line widget from own source file

brohr01
Associate II

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 1
LouisB
ST Employee

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,

Louis BOUDO
ST Software Developer | TouchGFX