Subscribe Bookmark RSS Feed

Widening the list box width of concatenate tables GUI

mikedriscoll

Community Trekker

Joined:

Jun 23, 2011

I find the width of the list boxes in the 'concatenate tables' GUI too narrow for my table names, which are very long. This script widens them using the set width function, argument in pixels.  The 500 in the Min() function might need to be varied based on screen resolution but it works for me.  Other GUIs may benefit from something similar but I use concatenate several orders of magnitude more often than other table platform manipulators like join. Use the 'show tree structure' feature and modify as needed.

BTW I found the "listboxbox" thing weird. Usually it is just "listbox."  That threw me for a loop for awhile until I noticed it.

new table("Most of my data tables have absurdly long but extraordinarily descriptive file names"); // when I ran this test I still had 3 other open tables with longer names; maxLen = 85 characters.

//actual script starts here

dt = current data table();

maxLen = 20;

for(i = 1, i<= N table(), i++,

      nameLen = data table(i) << get name;

           if(length(nameLen) > maxLen,

            maxLen = length(nameLen);

      );

);

dt<< concatenate();

//wait(0);

myWin = window("Concatenate");

wait(0);

myRef = myWin[Listboxbox(1)];//

myRef << set width(min(500, maxLen*6));// width in pixels, the *6 seemed about right.

myRef = myWin[Listboxbox(2)];//

myRef << set width(min(500, maxLen*6));