custom_test.py 461 B

1234567891011121314
  1. #!/usr/bin/env python3
  2. from nicegui import ui
  3. with ui.card():
  4. example = ui.custom_example(on_change=lambda number: label.set_text(f'Custom value: {number}'))
  5. ui.button('Add 100', on_click=lambda: example.add(100))
  6. label = ui.label()
  7. ui.joystick(on_move=lambda e: print("move", e.data.vector), color='blue', size=50)
  8. three = ui.three(on_click=lambda e: print("click", e.objects))
  9. ui.slider(min=0, max=10, on_change=lambda e: three.move_camera(e.value))