I know of two ways, and I haven't tried the second way with vtcl.
(1) re-arrange the order in which the objects are created. This is
tricky with vtcl because objects tend to have numbers for names (anyone
know how to fix this, or are there plans to change this?)
(2) for each object involved, bind the <tab> key to focus to the next
one.
Here's a little (straight) tk program that re-binds the cursor keys:
-------------- Cut here --------------------------
set irange "1 2 3 4 5 6"; # There are 6 scales, entries, and buttons.
foreach right {Right Down} {
bind Button <$right> {
focus [tk_focusNext %W]
}
}
foreach left {Left Up} {
bind Button <$left> {
focus [tk_focusPrev %W]
}
}
bind Entry <Down> {focus [tk_focusNext %W]}
bind Entry <Up> {focus [tk_focusPrev %W]}
bind Scale <Down> {focus [tk_focusNext %W]}
bind Scale <Up> {focus [tk_focusPrev %W]}
foreach s $irange {
scale ".s$s" -length 200 -var "s$s"
}
foreach s $irange {
entry ".e$s" -width 3 -textvar "s$s"
}
foreach s $irange {
button ".b$s" -text "Rnd$s" -command "set s$s \[expr int(rand() *
101)\]"
}
button .b7 -text "All" -command {
foreach s $irange {
set s$s [expr int(rand()*101)]
}
}
grid .s1 .s2 .s3 .s4 .s5 .s6 -row 0 -padx 1 -pady 1
grid .e1 .e2 .e3 .e4 .e5 .e6 -row 1 -padx 1 -pady 1
grid .b1 .b2 .b3 .b4 .b5 .b6 .b7 -row 2 -padx 1 -pady 1
focus -force .s1
-------------------- Cut here -------------------------
These bindings tell vtcl to re-focus on the next window in the series if
the cursor key is pressed. You can change this to use the tab key, and
specify which window to focus to. Also, you can "bind" to specific
widgets.
For simplicity, the first method is best; however, the second method may
be better for "on-the-fly" situations.
--Chuck
>----------
>From: George Kassyousef[SMTP:[EMAIL PROTECTED]]
>Sent: Friday, October 10, 1997 1:49 PM
>To: vtcl
>Subject: [vtcl] Tabing of widgets
>
>Quick question. Does anyone know how to set up the tabing of the
>widgets. I would like them to tab to the order I prefer.
>
>Thx in advance.
>
>--
>George Kassyousef Newbridge Networks
>OTA Systems Engineer 349 TerryFox Dr. Kanata Ont. Canada
> (613)599-3600 x1630
> "All Work And No Play"
>
>
>
>------------------------------------------------------------------------
>---
>To unsubscribe from the Visual Tcl mailing list, please send a message
>to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
>message body (where [EMAIL PROTECTED] is your e-mail address).
>
---------------------------------------------------------------------------
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).