I have a code designed to show a 2-dimensional histogram. I have a TExec that updates a pad/text to show which bin the user’s mouse is over, and on click creates another canvas with more information. Ideally I would like to draw lines on a pad on the spawned canvas, but they appear in the wrong place (somewhere on the original canvas) despite calls to TPad::cd().
I’ve made a small example which reproduces the bug:
My original code is a mix of macro and compiled code and I can update the pad/text with mouse position. However, the example is a pure macro and the pad/text for the mouse position doesn’t update until the second canvas is drawn, despite calling TPad::Update() in the same way as my original code.
As far as where the TLines appear, they usually appear in the most recently updated pad (e.g., the pad where I show the text with mouse position information). However, I added the TExec to the pad with some original TLines, and now they appear there.