home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / e / EasyGUI_v33b2.lha / Src / EasyGUI / button_test.e < prev    next >
Text File  |  1997-02-10  |  1KB  |  43 lines

  1. MODULE 'tools/easygui', 'tools/exceptions',
  2.        'plugins/button'
  3.  
  4. DEF b2=NIL:PTR TO button
  5.  
  6. PROC main() HANDLE
  7.   DEF b1=NIL:PTR TO button, b3=NIL:PTR TO button,
  8.       bp=NIL:PTR TO button
  9.   NEW bp.togglebutton('Paused')
  10.   easyguiA('BOOPSI in EasyGUI!',
  11.     [ROWS,
  12.       [TEXT,'Button test...',NIL,TRUE,5],
  13.       [COLS,
  14.         [PLUGIN,{buttonaction1},NEW b1.togglebutton('New')],
  15.         [PLUGIN,{buttonaction1},NEW b2.pushbutton('Open')],
  16.         [PLUGIN,{buttonaction2},NEW b3.button('Save')],
  17.         [PLUGIN,{buttonaction3},bp]
  18.       ],
  19.       [SBUTTON,{toggle_enabled},'Toggle Enabled',bp]
  20.     ])
  21. EXCEPT DO
  22.   END b1,b2,b3,bp
  23.   report_exception()
  24. ENDPROC
  25.  
  26. PROC buttonaction1(i,b:PTR TO button)
  27.   WriteF('button selected=\d\n', b.selected)
  28. ENDPROC
  29.  
  30. PROC buttonaction2(i,b:PTR TO button)
  31.   WriteF('button selected=\d\n', b.selected)
  32.   b2.setselected(FALSE)
  33. ENDPROC
  34.  
  35. PROC buttonaction3(i,b:PTR TO button)
  36.   WriteF('button selected=\d\n', b.selected)
  37.   b.settext(IF b.selected THEN 'Play' ELSE 'Paused')
  38. ENDPROC
  39.  
  40. PROC toggle_enabled(b:PTR TO button,i)
  41.   b.setdisabled(b.disabled=FALSE)
  42. ENDPROC
  43.