Canvas removeShape help

Custom indicators, trading strategies, data export and recording and more...
rickbarlow
Posts: 43
Joined: Mon Feb 08, 2021 5:37 pm
Been thanked: 1 time

Canvas removeShape help

Post by rickbarlow » Fri Mar 05, 2021 1:38 am

CanvasIcon old;
timelineCanvas = screenSpaceCanvasFactory.createCanvas(ScreenSpaceCanvasType.RIGHT_OF_TIMELINE);
timelineCanvas.removeShape(old);

I am trying to remove an old CanvasIcon after I am done with it using the code above, but the icon remains on the screen. Is there something else that I need to do? I have N number of icons that I want to remain on the screen, and just the one to be removed.
 

Svyatoslav
Site Admin
Posts: 278
Joined: Mon Jun 11, 2018 11:44 am
Has thanked: 2 times
Been thanked: 31 times

Re: Canvas removeShape help

Post by Svyatoslav » Fri Mar 05, 2021 9:56 am

Are you sure the icon that you are removing is actually the same one you added? I assume your code sample is incomplete (uninitialized variable, freshly created canvas with no icons has icon removed from it), so if possible please provide a more complete example.

rickbarlow
Posts: 43
Joined: Mon Feb 08, 2021 5:37 pm
Been thanked: 1 time

Re: Canvas removeShape help

Post by rickbarlow » Mon Mar 15, 2021 8:40 pm

User error. I found the problem in my code. Thanks.

Post Reply