BUTTON Object

Button is a push-button displaying a text label or an image. It can trigger events and/or control a boolean value

000010  IDENTIFICATION DIVISION.
000020  PROGRAM-ID.    demobutton.
000030  ENVIRONMENT DIVISION.
000040  DATA DIVISION.
000050  WORKING-STORAGE SECTION.
        01 abutton              usage pointer.
000230  
000240  PROCEDURE DIVISION.
000260
000270          invoke SUPER "addform" returning SELF.
 
                 move  "GuiCOBOL TEST for button"  to "caption" of self

                 move "blue"   to "color" of self
                  
                 invoke self  "addbuttonto" using "Press me" "pressedkey" returning abutton

                 invoke self "show"
               
                 invoke SELF "run"
000280
001080           stop run.
001090
001100  end program demobutton.

001110
        identification division.
001130  program-id. pressedkey.
001140  data division.
001150  working-storage section.
001160

001260  procedure division.
001270 

                    move "you pressed the button key " to "warning" of self.
                          
001350  exit program.
001360  end program pressedkey.
001110