Redraw image on 'click'
This is an example given in the tool guide. It crashes CS4 on mac when I run it. I am trying to learn how to create a custom button that i can redraw when clicked creating the effect similar to toggle only custom image.
var res =
"""palette {
text:’Custom elements demo’,
properties:{ closeOnKey:’OSCmnd+W’, resizeable:true },
customBtn: Custom {
type:’customButton’,
text:’Redraw original image’
},
customImageViewer: Custom {
type:’customView’,
alignment:[’fill’,’fill’]
}
}""";
var w = new Window (res);
w.customBtn.onDraw = drawButton;
w.customBtn.addEventListener (’mouseover’, btnMouseEventHandler, false);
w.customBtn.addEventListener (’mouseout’, btnMouseEventHandler, false);
...
function btnMouseEventHandler (event) {
try {
// Redraw the button on mouseover and mouseout
event.target.notify("onDraw");
}
catch (e) {
}
}
function drawButton (drawingState) {
...
}
