Created
December 16, 2011 17:03
-
-
Save narrowtux/1486905 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contianer c = new GenericContainer(); | |
c.setLayout(new VerticalLayout()); | |
c.setGeometry(5,5,width - 10, height - 10); | |
c.attachWidget(addon, new GenericLabel("Title")); //Same as c.getLayout().addItem(new WidgetItem(widget)); | |
c.getLayout().addItem(new SpacerItem(0, 25, 0, Integer.INFINITY)); //minWidth, minHeight, maxWidth, maxHeight | |
Button b = new GenericButton("Done"); | |
b.setMaxWidth(200); | |
c.attachWidget(addon, b); | |
c.getLayout().setAlign(WidgetAnchor.TOP_CENTER); | |
screen.attachWidget(addon, c); | |
/* | |
this would make a screen where the title would be top-center, the button bottom-center (because the spacer pushes them out of each other). | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment