For completeness, something similar with “nil” instead of fixed size (but nothing wrong with the other solution!)
(
var view = View().layout_(HLayout(
nil,
Button().states_([
["blah", Color.white, Color.black],
["blah", Color.black, Color.red]
]),
nil,
// the entire VLayout becomes one entry in the row
VLayout(
nil,
Button().states_([// maybe set a fixedSize
[">", Color.green, Color.black],
["<", Color.red, Color.black]
]),
Button().states_([
["-", Color.green, Color.black],
["o", Color.red, Color.black]
]),
nil
),
nil,
Slider().orientation_(\vertical),
nil,
Slider().orientation_(\vertical),
nil
)
);
view.front
)
or if you don’t like the sliders resizing
(
var view = View().layout_(HLayout(
nil,
Button().states_([
["blah", Color.white, Color.black],
["blah", Color.black, Color.red]
]),
nil,
// the entire VLayout becomes one entry in the row
VLayout(
nil,
Button().states_([// maybe set a fixedSize
[">", Color.green, Color.black],
["<", Color.red, Color.black]
]),
Button().states_([
["-", Color.green, Color.black],
["o", Color.red, Color.black]
]),
nil
),
nil,
VLayout(nil, Slider().orientation_(\vertical), nil),
nil,
VLayout(nil, Slider().orientation_(\vertical), nil),
nil
)
);
view.front
)
or perhaps you want to keep the blah button close to the arrows:
(
var view = View().layout_(HLayout(
nil,
Button().states_([
["blah", Color.white, Color.black],
["blah", Color.black, Color.red]
]),
// the entire VLayout becomes one entry in the row
VLayout(
nil,
Button().states_([// maybe set a fixedSize
[">", Color.green, Color.black],
["<", Color.red, Color.black]
]),
Button().states_([
["-", Color.green, Color.black],
["o", Color.red, Color.black]
]),
nil
),
nil,
VLayout(nil, Slider().orientation_(\vertical), nil),
nil,
VLayout(nil, Slider().orientation_(\vertical), nil),
nil
)
);
view.front;
)
anyway…you get the idea 