CREATE STATTEXT Example


Example:

 

*

 

 

.Define the STATTEXT, COLORS, BUTTON, and other variables

.

 

 

STEXT

STATTEXT

(5)

COLORS

COLOR

(3)

BUTTON1

BUTTON

 

RESULT

FORM

2

*

 

 

.Create the Objects

.

 

 

  

CREATE

COLORS(1)=*BLUE

  

CREATE

COLORS(2)=*YELLOW

  

CREATE

COLORS(3)=*RED

.

 

 

  

CREATE

STEXT(1)=2:3:30:49,"Static Text Message":

  

  

"SYSTEM(8,BOLD)",BORDER,BDRCOLOR=COLORS(1)

  

CREATE

STEXT(2)=5:6:30:53,"Static Text Message":

  

  

"FIXED(10,BOLD)"

  

CREATE

STEXT(3)=7:8:30:52,"Static Text Message":

  

  

"HELVETICA(12,BOLD)",BGCOLOR=COLORS(2)

  

CREATE

STEXT(4)=10:11:30:61,"Static Text Message":

  

  

"TIMES(14,ITALIC)",FGCOLOR=COLORS(3)

  

CREATE

STEXT(5)=13:14:23:57,"Static Text Message":

  

  

"SYSTEM(20,BOLD)",BORDER

.

 

 

  

CREATE

BUTTON1=16:17:35:42,"Exit"

*

 

 

.Activate All of the STATTEXT Objects and the BUTTON

.

 

 

  

ACTIVATE

STEXT // All Five STATTEXT Objects

  

ACTIVATE

BUTTON1,EXIT,RESULT

*

 

 

.Wait for an Event to Occur

.

 

 

  

LOOP

 

  

  EVENTWAIT

 

  

REPEAT

 

*

 

 

.Exit Button Selected

.

 

 

EXIT

 

 

  

STOP

 

 

This example creates five (5) STATTEXT objects with differing properties. Note that all of the STATTEXT objects are activated using a single ACTIVATE statement. When the Exit BUTTON is clicked, the program terminates.

 



PL/B Language Reference CREATE SPLITTER Example CREATE STATUSBAR Example