ComboBox List TextWrap

Is there a simple way to wrap the text on a ComboBox list ? so far we do have some lines that are longer than the list and the text get cut with those … and because of similar data between the lines it is hard to select the correct line, usually the last word changes but because of the list limit it does not show

Thanks .

Is there a way to wrap the text ? for example I get the text length and then the control width and if bigger I split in in parts, but the question is how do I split it ?based on what ?

No way that I know of. You can always create your own “list” by using the mouse down event and “pop up” a window containing a list box that can handle the multiple line drawing. Not trivial, mind you, but a way that I might approach it.

You could try using a monospace font for that particular combobox. Test what your combobox can hold, and then split the strings before that point.

Maybe not the nicest looking, but with a font like IBM’s Plex Mono it could be passable.

I’ll start by saying, that in theory it’s possible with some hacking as the Combo box contains a NSTextFieldCell, however I’ll stop you there and say that it’s probably not a good idea as the ComboBox is also a weird control and does many things that are not standard with other controls.

I would suggest you consider making your own, with a textfield and a popup menu or triangle.

Can’t you just tuck the complete string into the rowtag and then ask for it?