Listbox columnWidths maximum size?

Community Beginner ,
Feb 08, 2022 Feb 08, 2022

Copy link to clipboard


Is there a way to set maximum size for a column in Listbox?


I have a listbox with several colums

var list = my_palette.add('ListBox', [0, 0, 710, 300],undefined,
                        {numberOfColumns: 7, showHeaders: true,
                        columnTitles: ['#','Layer Name', 'Comp Name','Text','1','2','3'],multiselect:true,columnWidths:[30,190,190,210,20,30,30],});

But these columnwidths are only setup in creation and they behave like minimumSize. Which is ok. But I load layer name, comp name and source text into colums. These in length can easily breach the 190,190,210 widths  I have initially set up for them and scrollbar appers and the UI is no longer "pretty".


I am ok with the text not showing fully but I can not find a way to set a maximum size for these columns. I have tried trimming the number of characters to show in the column, but the problem is I can easily fit like 40 "thin" characters in preview like "i" and "f", but when the text has a lot of "thick" characters like "m" or "w" i can fit only like 20...which is a big difference.


Any help is appreciated.

How to , Preview , Scripting







Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation