I would like to create a panel with 3 buttons:
- button - add image 1
- button - add image 2
- Cancel
var dlg = new Window( "dialog", "Alert Box Builder" );
dlg.btnPnl = dlg.add( "panel", undefined, "Build it" );
dlg.btnPnl.testBtn = dlg.btnPnl.add( "button", undefined, "Test" );
dlg.btnPnl.buildBtn = dlg.btnPnl.add( "button", undefined, "Build", {name: "ok" } );
dlg.btnPnl.cancelBtn = dlg.btnPnl.add( "button", undefined, "Cancel", { name: "cancel" } );
dlg.show();
You are on the right track! Doing this just requires adding one more button and then adding a special
onClick
function for the buttons. That function will open up the operating system's file browser and then assign a file to thepic1File
andpic2File
variables.Hope that helps!