Box is a general-purpose container widget which aligns and packs its widgets either horizontally or vertically based on their size requisitions and adds spacing and padding. Overflowing widgets are clipped.
000010 IDENTIFICATION DIVISION.
000020 PROGRAM-ID. boxdemo.
000030 ENVIRONMENT DIVISION.
000040 DATA DIVISION.
000050 WORKING-STORAGE SECTION.
000060 01 abox usage pointer external.
000070 01 bside usage pointer external.
000080 01 alabel usage pointer.
000090
000100 PROCEDURE DIVISION.
000110
000120 invoke SUPER "addform" returning SELF.
000130
000140 invoke self "size" using 400 50
000150
000160 move "GuiCOBOL TEST " to "caption" of self
000170
000180 move "white" to "backcolor" of self
000190
000200 invoke self "addbox" returning abox
000201
000202 move "green" to "textcolor" of abox
000210
000220 move "this is the box caption" to "caption" of abox.
000230
000240
000250 invoke abox "addlabel" using "a label " returning alabel
000260
000280 move "blue" to "textcolor" of alabel
000290 move "magenta" to "backcolor" of alabel
000300
000310
000320 invoke self "show"
000330
000340 invoke SELF "run"
000350
000360 stop run.
000370
000380 end program boxdemo.