eventsource.bmx 539 B

1234567891011121314151617181920212223
  1. SuperStrict
  2. Import MaxGUI.Drivers
  3. Local MyWindow:TGadget=CreateWindow("Two Buttons Example", 200,200,320,240)
  4. Local Button1:TGadget=CreateButton("One",140,40,80,40, MyWindow)
  5. Local Button2:TGadget=CreateButton("Two",140,100,80,40, MyWindow)
  6. Repeat
  7. WaitEvent()
  8. Select EventID()
  9. Case EVENT_WINDOWCLOSE
  10. End
  11. Case EVENT_GADGETACTION
  12. Select EventSource()
  13. Case Button1
  14. SetGadgetText(Button1,"One clicked")
  15. Case Button2
  16. SetGadgetText(Button2,"Two clicked")
  17. End Select
  18. End Select
  19. Forever