Hi Jacob,
I tried your idea on Windows7 , CC2014, and the event does not trigger.
Only when a child is added, it does trigger, but on the child, not the window itself.
It’s pretty cool idea though, given that .onActivate does not work for dockable panels.
I tried it on a dockable panel instead of a palette, and it seems to work, but again might be version dependant (AE or OS).
This is the code i used:
pal = this instanceof Panel ? this : new Window("palette", "name", undefined, {resizeable:false});
pal.add("button{text: 'button 1'}");
pal.add("button{text: 'button 2'}");
pal.add("button{text: 'button 3'}");
pal.addEventListener("mouseover", mouseoverHandler);
function mouseoverHandler(ev){
if (!ev.view.parent){
this.children[1].enabled = !this.children[1].enabled;
};
};
pal instanceof Window ? pal.show() : pal.layout.layout(true);
(i removed the alert and changed it to something softer, otherwise the event never stops triggering).
Event stuff is ancient Egyptian for me, but this should be roughly true:
Inside the event, ‘this’ is the graphic element the listener was attached to (the window or panel).
ev.view is the graphic element that triggers the event.
So: !ev.view.parent means that the graphic element that triggered the event is a top level container.
Xavier