This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
blog:new_xscalawt_feature-_assign_to_properties [2011/02/11 22:03] djo |
blog:new_xscalawt_feature-_assign_to_properties [2014/10/17 22:08] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== New XScalaWT feature- Assign to properties ====== | ||
+ | |||
+ | In XScalaWT, to set a layout, you previously would write (same as Java): | ||
+ | |||
+ | <code java> | ||
+ | setLayout(new FillLayout()) | ||
+ | </code> | ||
+ | |||
+ | Now, you can write: | ||
+ | |||
+ | <code java> | ||
+ | layout = new FillLayout() | ||
+ | </code> | ||
+ | |||
+ | Most SWT properties now work this way. So for example instead of using setters everywhere you can now write code like: | ||
+ | |||
+ | <code java> | ||
+ | progressBar( | ||
+ | minimum = 0, | ||
+ | maximum = 50, | ||
+ | selection = 20 | ||
+ | ) | ||
+ | </code> | ||
+ | |||
+ | Which is much cleaner and easier to follow. | ||
+ | |||
+ | Thanks much to Jean-Philippe Pellet for the idea and implementation of this feature! | ||
+ | |||
+ | XScalawt can be found on GitHub at: https://github.com/pieceoftheloaf/XScalaWT/tree/gh-pages | ||
+ | |||
+ | ~~LINKBACK~~ | ||
+ | ~~DISCUSSION:closed~~ | ||