Hey guys,
I'm experiencing a weird issue with StaticText, specifically it being limited in characters once I set an initial text value. Basically I'm building a progress bar window: I have a function that builds the UI with all the elements/text, and another function that updates the UI.
When I build the UI and set the initial text value to "XXX", then attempt to change it via my updateProgressBar function, the new text value is limited to 3 characters ("XXX"). Likewise, if I change the initial text value to nothing "", when I update the text, it displays nothing. Basically, whatever I set as the initial text in the UI, that's the max # of characters I can have, even when trying to update the text to something else via my updateProgressBar function. The weird thing is, everything is 100% functional and the progress bar/text DOES update, it's just the StaticText is limited in # of characters.
Anyone experience this issue? I'm thinking it has something to do with the way I'm building the UI/functions. Any help would greatly be appreciated.
Thanks!
// Build progress bar var progressBarWindow = buildProgressBar(); var totalLayers = myPalette.grp.mainGroup.extrusionGroup.extrusionCopies.text * numSelectedLayers; var progressCounter = 0; // Update progress bar progressCounter = progressCounter + 1; updateProgressBar(progressBarWindow, 0, totalLayers, progressCounter); // Function that updates progress bar function updateProgressBar(progressWindow, min, max, curValue){ progressWindow.grp.mainPanel.progressBarUI.minvalue = min; progressWindow.grp.mainPanel.progressBarUI.maxvalue = max; progressWindow.grp.mainPanel.progressBarUI.value = curValue; progressWindow.grp.mainPanel.progressTxt.text = "Processing: " + curValue + "/" + max + " layers"; } // Builds window for progress bar function buildProgressBar() { var myWin = new Window("palette", "Extruding...", undefined, {resizeable:false}); if (myWin != null) { var res = "group {orientation:'column', alignment:['fill','fill'],\ mainPanel: Group {text:'Add/Edit List Item', orientation:'column', alignment:['fill', 'fill'], minimumSize:['250','50'], spacing:5 ,\ progressBarUI: Progressbar {alignment:['fill','top']} ,\ progressTxt: StaticText {text:'XXXXXXXXXXXXXXXXXXXXXX', alignment:['left','top']},\ },\ }"; myWin.grp = myWin.add(res); myWin.layout.layout(true); myWin.layout.resize(); myWin.onResizing = myWin.onResize = function(){this.layout.resize()}; myWin.show(); return myWin; } }