textfield_test.monkey2 588 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #import "<std>"
  2. #import "<mojo>"
  3. #import "<mojox>"
  4. Using std..
  5. Using mojo..
  6. Using mojox..
  7. Class MyWindow Extends Window
  8. Method New()
  9. Super.New( "TextField Demo",640,480,WindowFlags.Resizable )
  10. Local textField:=New TextField
  11. textField.Entered=Lambda()
  12. New Fiber( Lambda()
  13. Alert( "Text Entered: "+textField.Text )
  14. textField.MakeKeyView()
  15. End )
  16. End
  17. Local label:=New Label( "Enter your name:" )
  18. label.AddView( textField )
  19. ContentView=label
  20. textField.MakeKeyView()
  21. End
  22. End
  23. Function Main()
  24. New AppInstance
  25. New MyWindow
  26. App.Run()
  27. End