final Box box = new Box();
return new Group(AxisLayout.vertical().offEqualize()).add(
new Group(AxisLayout.horizontal().gap(15), GREENBG).add(
toggle3, AxisLayout.stretch(disabled)),
new Group(AxisLayout.horizontal().gap(15), GREENBG).add(
new LongPressButton("Long Pressable").onLongPress(new UnitSlot() {
@Override public void onEmit () { pressResult.text.update("Long pressed"); }
}).onClick(new UnitSlot() {
@Override public void onEmit () { pressResult.text.update("Clicked"); }
}), AxisLayout.stretch(pressResult)),
new Group(AxisLayout.horizontal().gap(15), GREENBG).add(
new Label("Image button"),
new ImageButton(tile(squares, 0), tile(squares, 1)).onClick(new UnitSlot() {
@Override public void onEmit () { clickCount.increment(1); }
}),
new ValueLabel(clickCount)),
new Group(AxisLayout.horizontal().gap(15), GREENBG).add(
new Button("Fill Box").onClick(new UnitSlot() {
@Override public void onEmit () {
box.set(new Label(box.contents() == null ? "Filled" : "Refilled"));
}
}),
box),
new Group(AxisLayout.horizontal().gap(15), GREENBG).add(
throbber.onClick(new UnitSlot() {
@Override public void onEmit () {
throbber.throb();
}
}))
);