PBUTTON  - v14


pbutton                     p=<i> {, b=<i>}, add=<button spec>, layout=<options> |
p=<i>, del, b=<j>

Function

Allow adding and removal of buttons from an existing panel.

Parameters

p

Indicates the number of the panel in which the button is present

 

 

b

Specify the index of the button to be added or removed. This parameter is also mandatory when using the "add" primer .
 

add=<button spec>

 

Specify the option-file information that determines the new button.

layout

Where the four integer values options specified are the four corners as provided by the layout file in the OPTION command.

del

Remove the button whose index is defined by means of the b= option.

Examples

 

pbutton p=1,b=1,add='1,0,2,220,31,3,6,1,"New Button 1":;'

pbutton p=1,del,b=1

pbutton p=1,b=1,add='1,0,2,220,31,3,6,1,"Another Button 1":;'

Notes

Refer to GUI guide to see interesting examples of use of PBUTTON including on auto-resizable controls

 

See Also

panel, options

Sample

Pbutton.cmd

{

panel on,p=1,u=1,c=220,r=64,j=0.25,0.9,mod=1,pin=0,t='Pbutton Command'

options on,p=1,f=pbutton

polling;' This is the original panel ';;

#

# Remove first button

pbutton p=1,del,b=1

#

# Add another button

pbutton p=1,b=1,add='1, 0, 2, 220, 31, 3, 6, 1,"New But 1":;'

polling;' This is the new panel, where button 1 has been replaced';;

panel off,p=1

}

Pbutton.tab

1, 0, 2, 220, 31, 3, 6, 1,'Button 1':;

2, 0, 36, 100, 24,0, 0, 6,'':

3,160, 33, 60, 31, 3, 6, 1,'But 2':;

 

pbutton p=1,b=1,del

pbutton p=1,b=1,  add='1,0,0,400,200,0,0,506,"listsort1.dat":;',layout=0,0,100,100