source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/vrippack-0.31/lib/linux/tk8.4/demos/spin.tcl @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 2.0 KB
Line 
1# spin.tcl --
2#
3# This demonstration script creates several spinbox widgets.
4#
5# RCS: @(#) $Id: spin.tcl,v 1.1 2001/10/30 11:21:50 dkf Exp $
6
7if {![info exists widgetDemo]} {
8    error "This script should be run from the \"widget\" demo."
9}
10
11set w .spin
12catch {destroy $w}
13toplevel $w
14wm title $w "Spinbox Demonstration"
15wm iconname $w "spin"
16positionWindow $w
17
18label $w.msg -font $font -wraplength 5i -justify left -text "Three different\
19        spin-boxes are displayed below.  You can add characters by pointing,\
20        clicking and typing.  The normal Motif editing characters are\
21        supported, along with many Emacs bindings.  For example, Backspace\
22        and Control-h delete the character to the left of the insertion\
23        cursor and Delete and Control-d delete the chararacter to the right\
24        of the insertion cursor.  For values that are too large to fit in the\
25        window all at once, you can scan through the value by dragging with\
26        mouse button2 pressed.  Note that the first spin-box will only permit\
27        you to type in integers, and the third selects from a list of\
28        Australian cities."
29pack $w.msg -side top
30
31frame $w.buttons
32pack $w.buttons -side bottom -fill x -pady 2m
33button $w.buttons.dismiss -text Dismiss -command "destroy $w"
34button $w.buttons.code -text "See Code" -command "showCode $w"
35pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
36
37set australianCities {
38    Canberra Sydney Melbourne Perth Adelaide Brisbane
39    Hobart Darwin "Alice Springs"
40}
41
42spinbox $w.s1 -from 1 -to 10 -width 10 -validate key \
43        -vcmd {string is integer %P}
44spinbox $w.s2 -from 0 -to 3 -increment .5 -format %05.2f -width 10
45spinbox $w.s3 -values $australianCities -width 10
46
47#entry $w.e1
48#entry $w.e2
49#entry $w.e3
50pack $w.s1 $w.s2 $w.s3 -side top -pady 5 -padx 10 ;#-fill x
51
52#$w.e1 insert 0 "Initial value"
53#$w.e2 insert end "This entry contains a long value, much too long "
54#$w.e2 insert end "to fit in the window at one time, so long in fact "
55#$w.e2 insert end "that you'll have to scan or scroll to see the end."
Note: See TracBrowser for help on using the repository browser.