From the documentation:
Overlay[{Subscript[expr, 1],Subscript[expr, 2],...},{i,j,...},s] allows selections to be made and controls to be clicked in Subscript[expr, s].
and an example of selecting one layer:
Overlay[{Slider2D[], Graphics[{Opacity[.2], Disk[]}]}, All, 1]
Does anyone know what the syntax is for cases in which you want controls to be clicked in more than one layer, or all layers?
I have tried:
Overlay[{Slider2D[], Graphics[{Opacity[.2], Disk[]}]}, All, All]
and
Overlay[{Slider2D[], Graphics[{Opacity[.2], Disk[]}]}, All, {1,2}]
without success.
Answer
I don't think the third argument of Overlay
can be used to do what you want. An alternative is to change the active layer dynamically using EventHandler
as in
DynamicModule[{layer = 1},
EventHandler[
Overlay[{Slider2D[], Graphics[{Opacity[.2], Disk[]}]}, All,
Dynamic[layer]], {{"MouseClicked", 2} :> ((layer = layer /. {1 -> 2, 2 -> 1}))},
PassEventsDown -> True]]
Comments
Post a Comment