SWT Setting Column Height or insert new line

妖精的绣舞 提交于 2019-12-23 16:44:33

问题


I currently have a Table [org.eclipse.swt.widgets.Table] with several TableColumns; however, due to UI space restrictions I have a bit of an issue.

Lets say for example I had a table column named "Target User" and this couldn't be named anything else AND the whole display "Target User" had to be displayed. Now lets say I also have several other Table Columns with the same problems.

I was hoping I could add a new line or do something to set the height of the column so it could be Target \n User and I could save some width that way. However, \n does not seem to work in org.eclipse.swt.widgets.TableColumn.setText , nor does html.

Any ideas?


回答1:


Apparently, this (the "\n" within a Label of a TableColumn) only works in Linux, not Windows.

See bug 97077 (2005!)

Linux/GTK implementation of table column can be easily made multiline inserting "\n" into text - should work in current implementations.
Windows implementation for this would be very tricky. In Win32 programming people either replace table control or table header control to get this functionality or create all kind of tricks to full ListView32 window to allow multiliner.



来源:https://stackoverflow.com/questions/1359295/swt-setting-column-height-or-insert-new-line

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!