Is it not possible to create Tabbed Panels and Tabs using a resource string?
On both CS5 and CS6 this works:
var win = new Window ("dialog","Tab Test");
win.matchtabs=win.add("tabbedpanel");
win.matchtabs.taba=win.matchtabs.add("tab",undefined,"Match #1");
win.matchtabs.tabb=win.matchtabs.add("tab",undefined,"Match #2");
win.show();
but this:
var res= "dialog { matchtabs: TabbedPanel { taba: Tab { text: 'Match #1' }, tabb: Tab { text: 'Match #2' } } }";
var win = new Window (res,"Tab Test");
win.show();
fails with "Error 19: ... TabbedPanel is not an object" , again both on CS5 and CS6.
Thanks for any insight.
Thanks very much Ichabodcole, very helpful and certainly not clear from the JS Tools Guide (as of CS6 version).
I ended up just using a couple of radio buttons to switch between panels set up as a stack and that worked for the particular script I was writing, but I will definitely use the method you outlined for future work.
I started to use the add/assign method to create the tabbed panel that way, but I am so accustomed to resource strings that I find the alternate way of creating dialog windows slow and difficult to implement. Additionally, this would have been my only script that didn't use the resource string method so I went the radiobutton route for consistency and maintainability, even if it didn't have exactly the UI I wanted.
I'm right there with you on the documentation issues, it makes this forum and the one over at ps-scripts all the more valuable.
Hi,
for those who don't know it, there's a (unofficial but very informative) pdf called ScriptUI for Dummies - I've discovered it recently and it may be considered a nice add-on to the JS Tools Guide for building interfaces.
Davide
North America
Europe, Middle East and Africa
Asia Pacific