tags:

views:

46

answers:

1

Is it possible to specify a fixed height for a widget - say, a canvas - in SWT? I'm looking into possibly porting an app of mine from LispWorks CAPI to Clojure with SWT, and it's crucial that I have this facility. Many thanks for any help, Chris.

A: 

SWT uses layout managers and 'hints' for widget sizes. In your case I'd say that AbsoluteLayout is the correct choice. But, be aware, SWT is backed by the native OS' widgets, so setting height on a native widgets may have no effect. There are quite a few custom-drawn widgets that come with SWT that you could use instead, e.g. CCombo.

arcticpenguin
Hi arcticpenguin - thanks for the suggestion.Chris
ChrisM
No problem. If you liked the answer would you please vote it up and mark it correct? Thanks.
arcticpenguin