home *** CD-ROM | disk | FTP | other *** search
- # CVS $Id: focus2.tcl,v 1.3 1995/02/03 16:54:38 zibi Exp $
- #
- # Simple test of VtSetFocus
- #
- # This test setting focus in a text field's activate callback.
- # Remember that text fields are a tab group.
- #
- proc focusCB {cbs} {
- set target [keylget cbs widget]
-
- VtSetFocus $target -direction NEXT_TAB_GROUP
- }
-
- set ap [VtOpen focus]
-
- set dlog [VtFormDialog $ap.form]
-
- VtLabel $dlog.lab -labelLeft -font medPlainFont \
- -label "This test a common focus problem,
- hitting the return key in each text field
- will select the next text field."
-
- set frame [VtFrame $dlog.frame -title "Bunch Of Text" -MOTIF_topOffset 10]
- set rc0 [VtRowColumn $frame.rc0 -vertical -rightSide FORM]
-
- foreach txt {a b c d e} {
- VtText $rc0.$txt -activateCallback "focusCB"
- }
-
- VtPushButton $rc0.quit -label Quit -callback { VtClose ;exit 0 ;#}
-
- VtShow $dlog
-
- VtMainLoop
-
-