Greetings. First time to this group, so please forgive if I post anything that seems trivial.
I can't figure why EventHandler is changing the size of my graphics within GraphicsRow. Snippet below illustrates.
`data = Table[RandomReal[], {r, 1, 5}, {c, 1, 5}]; (* Create array of random reals, range 0-1 *)
g1 = ArrayPlot[data, ColorFunction -> Hue, ImageSize -> Small]; (* Draw same array, two different sizes *)
g2 = ArrayPlot[data, ColorFunction -> Hue, ImageSize -> Medium];
GraphicsRow[{g1, g2}, ImageSize ->Automatic] (* Now, display g1 and g2 with GraphicsRow, which works fine*)
(* Below, wrap g1,g2 w EventHandler, which draws fine, but records clicks outside the boundary of the smaller figure (g1) *)
EventHandler[GraphicsRow[{g1, g2}, ImageSize ->Automatic], "MouseClicked" :> (Print["Mouse position =", MousePosition["Graphics"]]) ]
(* Below, wrap only g2 in EventHandler. This blows away the pre-set sizes of g1 and g2, drawing them the same size *)
GraphicsRow[{g1, EventHandler[g2, "MouseClicked" :> (Print["Mouse position =", MousePosition["Graphics"]]) ]}, ImageSize ->Automatic]`
My question is: With just g2 wrapped in EventHandler, how can I get GraphicsRow to recognize g2's size settings? What I ultimately want to do is to wrap both g1 and g2 in separate event handlers, in order to filter out mouse clicks outside the boundaries of each.
Many thanks.
Bill