File: globs.tcl

package info (click to toggle)
xpvm 1.2.5-11
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,368 kB
  • ctags: 1,509
  • sloc: ansic: 22,799; tcl: 7,750; makefile: 101; csh: 11; sh: 10
file content (149 lines) | stat: -rw-r--r-- 2,770 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#
# $Id: globs.tcl,v 4.50 1998/04/09 21:12:36 kohl Exp $
#

#
#         XPVM version 1.1:  A Console and Monitor for PVM
#           Oak Ridge National Laboratory, Oak Ridge TN.
#           Authors:  James Arthur Kohl and G. A. Geist
#                   (C) 1994 All Rights Reserved
#
#                              NOTICE
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted
# provided that the above copyright notice appear in all copies and
# that both the copyright notice and this permission notice appear
# in supporting documentation.
#
# Neither the Institution, Oak Ridge National Laboratory, nor the
# Authors make any representations about the suitability of this
# software for any purpose.  This software is provided ``as is''
# without express or implied warranty.
#
# XPVM was funded by the U.S. Department of Energy.
#

puts -nonewline "\[globs.tcl\]"
flush stdout

#
# Compatibility Globals
#

if { $tcl_major_version > 7 || $tcl_minor_version >= 4 } \
{
	set XSCROLLINCREMENT -xscrollincrement
	set YSCROLLINCREMENT -yscrollincrement

	set FRAME_OFFSET 1

	set SELECTOR -selectcolor
} \
\
else \
{
	set XSCROLLINCREMENT -scrollincrement
	set YSCROLLINCREMENT -scrollincrement

	set FRAME_OFFSET 0

	set SELECTOR -selector
}

#
# Compatibility Procs
#

if { $tcl_major_version > 7 || $tcl_minor_version >= 4 } \
{
	proc restrict_bindings { win extra } \
	{
		#debug_proc restrict_bindings entry

		bindtags $win "$win $extra"

		#debug_proc restrict_bindings exit
	}
} \
\
else \
{
	proc restrict_bindings { win extra } \
	{ }
}

if { $tcl_major_version > 7 || $tcl_minor_version >= 4 } \
{
	proc do_xview { canvas location } \
	{
		#debug_proc do_xview entry

		$canvas xview moveto 0.0

		$canvas xview scroll $location units

		#debug_proc do_xview exit
	}
} \
\
else \
{
	proc do_xview { canvas location } \
	{
		#debug_proc do_xview entry

		$canvas xview $location

		#debug_proc do_xview exit
	}
}

if { $tcl_major_version > 7 || $tcl_minor_version >= 4 } \
{
	proc do_yview { canvas location } \
	{
		#debug_proc do_yview entry

		$canvas yview moveto 0.0

		$canvas yview scroll $location units

		#debug_proc do_yview exit
	}
} \
\
else \
{
	proc do_yview { canvas location } \
	{
		#debug_proc do_yview entry

		$canvas yview $location

		#debug_proc do_yview exit
	}
}

if { $tcl_major_version > 7 || $tcl_minor_version >= 4 } \
{
	proc entry_setup { entry cmd } \
	{
		bind $entry <Return> $cmd
	}
} \
\
else \
{
	proc entry_setup { entry cmd } \
	{
		bind $entry <Return> $cmd

		bind $entry <ButtonPress-2> "%W insert insert [selection get]"

		bind $entry <3> [ list %W scan mark %x ]

		bind $entry <Button3-Motion> [ list %W scan dragto %x ]
	}
}