mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-15 02:43:24 +03:00
examples/hello: Add select to LVGUI testing page
This commit is contained in:
parent
f17c882cb6
commit
8cba428242
@ -8,16 +8,35 @@ module GUI
|
||||
def initialize()
|
||||
super()
|
||||
|
||||
add_main_text(%Q{The different UI toolkit controls are shown here.\n\nThis is used to validate UI behaviour on different platforms.\n\n})
|
||||
add_main_text(%Q{The different UI toolkit controls are shown here.\n\nThis is used to validate UI behaviour on different platforms.\n})
|
||||
|
||||
LVGUI::HorizontalSeparator.new(@container)
|
||||
|
||||
add_main_text(%Q{\nThe description label here will mirror the switch's value.\n})
|
||||
|
||||
# Add a toggle switch
|
||||
@switch = add_switch(
|
||||
"Toggle switch",
|
||||
description: "This label will mirror its value in the description field after the first activation.",
|
||||
description: "true",
|
||||
initial: true,
|
||||
) do |new_state|
|
||||
@switch.set_description(new_state.inspect)
|
||||
end
|
||||
|
||||
LVGUI::HorizontalSeparator.new(@container)
|
||||
|
||||
add_main_text(%Q{\nThese items allow choosing among many options\n})
|
||||
|
||||
@select = add_select("Options selection", [
|
||||
[:A, "Option A"],
|
||||
[:B, "Option B"],
|
||||
[:C, "Option C"],
|
||||
[:D, "Option D"],
|
||||
#[:_Z, "An option with a label that is large enough to cause a line wrap"],
|
||||
#[:_X, "Commas wrap snuggly,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"],
|
||||
]) do |new_state|
|
||||
p new_state
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user