Copy a pad onto new canvas; colors inverted

Hi all,

I am writing an event display which by default shows a very crowded canvas: say 10+ pads each with ~5 histograms drawn. Mostly this is an overview used to look for anomalous signals. I’d like to build in the option to double-click on either a sub-pad or a single histogram to draw that pad or object full-scale on a new canvas.

The attached macro illustrates my basic plan for accomplishing this: use AddExec to attach a simple function that waits for double-clicks and does the cloning. Because events actually happen in sub-pads, the function checks for event ‘53’ (mouse exits) and propagates itself to the sub-pad to capture events there. Drawing of single objects works fine, but when I try to draw a whole subpad, the colors come out inverted until I click on the new canvas.

In addition to that major problem, some more general questions:

  1. Is this a reasonable way to approach the problem? Will using AddExec slow things down noticeably, especially over X11 forwarding? Is there a chance of attaching my exec function to other canvases/pads (other than ones created by it)?

  2. When copying a pad, it will sit on top of the new canvas’s pad. Is there a way to “transform” the pad into a canvas in it’s own right, or replace the canvas’s pad with the pad I’m trying to clone? This is mostly to help the part of the function that won’t try to copy an already full-sized canvas.

  3. Where are the different mouse event enums declared?

Many thanks,
~Ben
zoomer.C (1.46 KB)

really weird effect … no answer yet…