DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Creating SCOadmin wizards

Example wizard

proc Page2Init {parent} {
    VtSet [Widget text1] -value "maybe this is a text1"
    VtSet [Widget text2] -value "maybe this is a text2"
    VtSet [Widget input1] -value "maybe this is input field 1"
    VtSet [Widget input2] -value "maybe this is input field #2"
}

proc Page2Exit {parent} { return + }

proc Page1Init {parent} { global firstTime

if {![info exists firstTime]} { echo Page1Init VtSet [Widget text1] -value "this is a text1" VtSet [Widget text2] -value "this is a text2" VtSet [Widget input1] -value "this is input field 1" VtSet [Widget input2] -value "this is input field #2" } set firstTime 1 return 1 }

proc Page1Exit {parent} { echo "text1 = [VtGet [Widget text1] -value]" echo "text2 = [VtGet [Widget text2] -value]" echo "input1 = [VtGet [Widget input1] -value]" echo "input2 = [VtGet [Widget input2] -value]" return +second } proc WizardInit {} { echo "Initializing Wizard" } proc WizardExit {} { echo "Exiting Wizard" }

set Wizard(title) {this is a test} set Wizard(initCB) {WizardInit} set Wizard(exitCB) {WizardExit} set Wizard(firstPage) {first} set Wizard(nextLabel) {Next} set Wizard(previousLabel) {Previous} set Page(first,title) {this is the title of page 1} set Page(first,pixmap) {/test/wizard/find.px} set Page(first,initCB) {Page1Init} set Page(first,exitCB) {Page1Exit} set Page(first,ui) { {Object { {ObjectType VtForm} {ObjectName form1} {ObjectArguments {-rightSide FORM}} {Object { {ObjectType VtText} {ObjectName text1} {ObjectArguments {-topSide FORM}} }} {Object { {ObjectType VtText} {ObjectName text2} }} {Object { {ObjectType VxRadioBox} {ObjectName radiobox1} {ObjectArguments {-label Colors: -horizontal}} {Object { {ObjectType VtToggleButton} {ObjectName button1} {ObjectArguments {-value 1 -label Red}} }} {Object { {ObjectType VtToggleButton} {ObjectName button2} {ObjectArguments {-label Blue}} }} }} {Object { {ObjectType VtForm} {ObjectName innerform} {ObjectArguments \ {-marginWidth 0 -marginHeight 0 -rightSide FORM}} {Object { {ObjectType VtText} {ObjectName input1} }} {Object { {ObjectType VtText} {ObjectName input2} }} }} }} {Object { {ObjectType VtForm} {ObjectName form2} }} {Object { {ObjectType VtForm} {ObjectName form3} }} } set Page(second,title) {this is the title of page 2} set Page(second,pixmap) {/usr/lib/scoadmin/icons/examine.px} set Page(second,initCB) {Page2Init} set Page(second,exitCB) {Page2Exit} set Page(second,ui) { {Object { {ObjectType VtForm} {ObjectName form1} {ObjectArguments {-rightSide FORM}} {Object { {ObjectType VtText} {ObjectName text1} {ObjectArguments {-topSide FORM}} }} {Object { {ObjectType VtText} {ObjectName text2} }} {Object { {ObjectType VtForm} {ObjectName innerform} {ObjectArguments {-marginWidth 0 -marginHeight 0 -rightSide FORM}} {Object { {ObjectType VtText} {ObjectName input1} }} {Object { {ObjectType VtText} {ObjectName input2} }} }} }} {Object { {ObjectType VtForm} {ObjectName form2} }} {Object { {ObjectType VtForm} {ObjectName form3} }} }


Previous topic: Warning array description

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005