How to set width of listbox


#1

Is there a way to set the width of a dialog box like rhinoscriptsyntax.ListBox ? I am using python. I’ve tried giving it a long title and making the first item in the list extra long but it starts out with a small box and I have to drag the corner to make it large enough so that all the text is displayed in width


#2

The rhinoscript ListBox() function that calls this RhinoCommon method does not seem to have any option on window sizes.
I guess some custom UI coding needs to be done here, but I have no idea on how to do that.
Wait for the cavalry.

But I agree that it would be nice if we could be able to define the window/dialog/box sizes.
Even edit the screen position where the box will appear.


(Steve Baer) #3

I changed the list box for SR8 to autosize and be at least wide enough to display the widest item.


#4

Autosize means it will resize itself based on the larges dimension(width) among the three mentioned: widest item, message, title? Or just widest item?


(Steve Baer) #5

Just the widest item in the list. With the current code, the width never shrinks below the current size (only grows.)


#6

Ok.
But wouldn’t it be better if the growing size of the width is determined by the width of “message” and “title” strings too?


(Steve Baer) #7

Let’s see how this works once a release candidate is out for SR8 and then we can make tweaks if necessary.