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 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425
|
<!DOCTYPE HTML PUBLIC "-//Netscape_Microsoft//DTD HTML 3.0//EN">
<HTML>
<!-- This file generated using the Python HTMLgen module. -->
<HEAD>
<META NAME="GENERATOR" CONTENT="HTMLgen 1.1">
<TITLE>PmwBlt.py</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<PRE>
<FONT COLOR="#DD0000"># Python interface to some of the commands of the 2.1 version of the</FONT>
<FONT COLOR="#DD0000"># BLT extension to tcl.</FONT>
import types
import Tkinter
<FONT COLOR="#DD0000"># Supported commands:</FONT>
if Tkinter.TkVersion >= 8.0:
_busyCommand = <FONT COLOR="#009900">'blt::busy'</FONT>
_vectorCommand = <FONT COLOR="#009900">'blt::vector'</FONT>
_graphCommand = <FONT COLOR="#009900">'blt::graph'</FONT>
else:
_busyCommand = <FONT COLOR="#009900">'busy'</FONT>
_vectorCommand = <FONT COLOR="#009900">'vector'</FONT>
_graphCommand = <FONT COLOR="#009900">'graph'</FONT>
<FONT COLOR="#DD0000"># The graph and barchart widgets are essentially the same, so only</FONT>
<FONT COLOR="#DD0000"># graph has been ported. If you want bars, use the element_bar()</FONT>
<FONT COLOR="#DD0000"># method of Graph.</FONT>
_haveBlt = None
<STRONG>def _checkForBlt</STRONG>(window):
global _haveBlt
<FONT COLOR="#DD0000"># Blt may be a package which has not yet been loaded.</FONT>
try:
window.tk.call(<FONT COLOR="#009900">'package'</FONT>, <FONT COLOR="#009900">'require'</FONT>, <FONT COLOR="#009900">'BLT'</FONT>)
except Tkinter.TclError:
<FONT COLOR="#DD0000"># Another way to try to dynamically load blt:</FONT>
try:
window.tk.call(<FONT COLOR="#009900">'load'</FONT>, <FONT COLOR="#009900">''</FONT>, <FONT COLOR="#009900">'Blt'</FONT>)
except Tkinter.TclError:
pass
try:
window.tk.call(_busyCommand, <FONT COLOR="#009900">'windows'</FONT>)
_haveBlt = 1
except Tkinter.TclError:
_haveBlt = 0
<STRONG>def haveblt</STRONG>(window):
if _haveBlt is None:
_checkForBlt(window)
return _haveBlt
<STRONG>def busy_hold</STRONG>(window):
window.tk.call(_busyCommand, <FONT COLOR="#009900">'hold'</FONT>, window._w)
<STRONG>def busy_release</STRONG>(window):
window.tk.call(_busyCommand, <FONT COLOR="#009900">'release'</FONT>, window._w)
<FONT COLOR="#DD0000">#=============================================================================</FONT>
<FONT COLOR="#DD0000"># Interface to the blt vector command</FONT>
<FONT COLOR="#DD0000"># The dup, offset and populate methods and the +, -, * and / operations</FONT>
<FONT COLOR="#DD0000"># are not supported.</FONT>
<STRONG><FONT COLOR="#CC6600">class Vector</FONT></STRONG>:
_varnum = 0
<STRONG> def __init__</STRONG>(self, size=None, master=None):
if master:
self._master = master
else:
self._master = Tkinter._default_root
self._tk = self._master.tk
self._name = <FONT COLOR="#009900">'PY_VEC'</FONT> + str(Vector._varnum)
Vector._varnum = Vector._varnum + 1
if size is None:
self._tk.call(_vectorCommand, self._name)
else:
self._tk.call(_vectorCommand, self._name + <FONT COLOR="#009900">'('</FONT> + str(size) + <FONT COLOR="#009900">')'</FONT>)
<STRONG> def __del__</STRONG>(self):
self._tk.globalunsetvar(self._name)
<STRONG> def __str__</STRONG>(self):
return self._name
<STRONG> def __repr__</STRONG>(self):
rtnstr = <FONT COLOR="#009900">'['</FONT>
butFirst = 0
for value in self:
if butFirst:
rtnstr = rtnstr + <FONT COLOR="#009900">', '</FONT>
else:
butFirst = 1
rtnstr = rtnstr + str(value)
rtnstr = rtnstr + <FONT COLOR="#009900">']'</FONT>
return rtnstr
<STRONG> def __cmp__</STRONG>(self, list):
return cmp(self[:], list)
<STRONG> def __len__</STRONG>(self):
return self._tk.getint(self._tk.call(self._name, <FONT COLOR="#009900">'length'</FONT>))
<STRONG> def __getitem__</STRONG>(self, key):
if key < 0:
key = key + len(self)
try:
return self._tk.getdouble(self._tk.globalgetvar(self._name, str(key)))
except Tkinter.TclError:
raise IndexError
<STRONG> def __setitem__</STRONG>(self, key, value):
if key < 0:
key = key + len(self)
return self._tk.globalsetvar(self._name, str(key), float(value))
<STRONG> def __delitem__</STRONG>(self, key):
if key < 0:
key = key + len(self)
return self._tk.globalunsetvar(self._name, str(key))
<STRONG> def __getslice__</STRONG>(self, start, end):
string = self._tk.globalgetvar(self._name, str(start) + <FONT COLOR="#009900">':'</FONT> + str(end))
return map(self._tk.getdouble, self._tk.splitlist(string))
<STRONG> def __setslice__</STRONG>(self, start, end, list):
if end - start == len(list):
for count in range(end - start):
self[start + count] = list[count]
else:
self.set(self[:start] + list + self[end:])
<STRONG> def __delslice__</STRONG>(self, start, end):
self.unset(start, end - 1)
<STRONG> def set</STRONG>(self, list):
if type(list) != types.TupleType:
list = tuple(list)
self._tk.call(self._name, <FONT COLOR="#009900">'set'</FONT>, list)
<STRONG> def get</STRONG>(self):
<FONT COLOR="#DD0000"># This should be "return self[:]", but there is a bug in blt vector.</FONT>
string = self._tk.call(self._name, <FONT COLOR="#009900">'range'</FONT>, 0, <FONT COLOR="#009900">'end'</FONT>)
return map(self._tk.getdouble, self._tk.splitlist(string))
<STRONG> def append</STRONG>(self, value):
<FONT COLOR="#DD0000"># This should be as follows, but there is a bug in blt vector unset.</FONT>
# self._tk.call(self._name, <FONT COLOR="#009900">'append'</FONT>, args) (given *args as second param)
return self._tk.globalsetvar(self._name, <FONT COLOR="#009900">'++end'</FONT>, float(value))
<STRONG> def count</STRONG>(self, start):
return len(self._tk.splitlist(self._tk.call(self._name, <FONT COLOR="#009900">'search'</FONT>, start)))
<STRONG> def search</STRONG>(self, start, end=None):
return self._master._getints(self._tk.call(
self._name, <FONT COLOR="#009900">'search'</FONT>, start, end))
<STRONG> def index</STRONG>(self, value):
strings = self._tk.splitlist(self._tk.call(self._name, <FONT COLOR="#009900">'search'</FONT>, value))
if len(strings) == 0:
raise ValueError, str(value) + <FONT COLOR="#009900">' not in list'</FONT>
return self._tk.getint(strings[0])
<STRONG> def insert</STRONG>(self, index, value):
self[index:index] = [value]
<STRONG> def remove</STRONG>(self, value):
del self[self.index(value)]
<STRONG> def reverse</STRONG>(self):
s = self[:]
s.reverse()
self[:] = s
<STRONG> def sort</STRONG>(self, *args):
apply(self._tk.call, (self._name, <FONT COLOR="#009900">'sort'</FONT>) + args)
<STRONG> def sort_reverse</STRONG>(self, *args):
apply(self._tk.call, (self._name, <FONT COLOR="#009900">'sort'</FONT>, <FONT COLOR="#009900">'-reverse'</FONT>) + args)
<STRONG> def min</STRONG>(self):
return self._tk.getdouble(self._tk.globalgetvar(self._name, <FONT COLOR="#009900">'min'</FONT>))
<STRONG> def max</STRONG>(self):
return self._tk.getdouble(self._tk.globalgetvar(self._name, <FONT COLOR="#009900">'max'</FONT>))
<STRONG> def clear</STRONG>(self):
self._tk.call(self._name, <FONT COLOR="#009900">'clear'</FONT>)
<STRONG> def delete</STRONG>(self, *args):
apply(self._tk.call, (self._name, <FONT COLOR="#009900">'delete'</FONT>) + args)
<STRONG> def length</STRONG>(self, newSize=None):
return self._tk.getint(self._tk.call(self._name, <FONT COLOR="#009900">'length'</FONT>, newSize))
<STRONG> def range</STRONG>(self, first, last=None):
string = self._tk.call(self._name, <FONT COLOR="#009900">'range'</FONT>, first, last)
return map(self._tk.getdouble, self._tk.splitlist(string))
<FONT COLOR="#DD0000">#=============================================================================</FONT>
<STRONG><FONT COLOR="#CC6600">class Graph</FONT></STRONG>(Tkinter.Widget):
<FONT COLOR="#DD0000"># Wrapper for the blt graph widget, version 2.1.</FONT>
<STRONG> def __init__</STRONG>(self, master=None, cnf={}, **kw):
Tkinter.Widget.__init__(self, master, _graphCommand, cnf, kw)
<STRONG> def _configure</STRONG>(self, subcommand, option, kw):
<FONT COLOR="#DD0000"># Handle configuration of widgets, canvas items, text items,</FONT>
<FONT COLOR="#DD0000"># images, etc. Supports the forms configure() and</FONT>
# configure(<FONT COLOR="#009900">'font'</FONT>) for querying and configure(font = <FONT COLOR="#009900">'fixed'</FONT>,
# text = <FONT COLOR="#009900">'hello'</FONT>) for setting.
if not option and not kw:
<FONT COLOR="#DD0000"># Return a description of all options.</FONT>
ret = {}
options = self.tk.splitlist(apply(self.tk.call, subcommand))
for optionString in options:
optionInfo = self.tk.splitlist(optionString)
option = optionInfo[0][1:]
ret[option] = (option,) + optionInfo[1:]
return ret
if option:
<FONT COLOR="#DD0000"># Return a description of the option given by <option>.</FONT>
if kw:
<FONT COLOR="#DD0000"># Having keywords implies setting configuration options.</FONT>
<FONT COLOR="#DD0000"># Can't set and get in one command!</FONT>
raise ValueError, <FONT COLOR="#009900">'cannot have option argument with keywords'</FONT>
option = <FONT COLOR="#009900">'-'</FONT> + option
optionInfo = self.tk.splitlist(
apply(self.tk.call, subcommand + (option,)))
return (optionInfo[0][1:],) + optionInfo[1:]
<FONT COLOR="#DD0000"># Otherwise, set the given configuration options.</FONT>
apply(self.tk.call, subcommand + self._options(kw))
<STRONG> def extents</STRONG>(self, item):
return self.tk.getint(self.tk.call(self._w, <FONT COLOR="#009900">'extents'</FONT>, item))
<STRONG> def invtransform</STRONG>(self, winX, winY):
return self._getdoubles(
self.tk.call(self._w, <FONT COLOR="#009900">'invtransform'</FONT>, winX, winY))
<STRONG> def transform</STRONG>(self, x, y):
return self._getdoubles(self.tk.call(self._w, <FONT COLOR="#009900">'transform'</FONT>, x, y))
<FONT COLOR="#DD0000"># The axis commands may be called in one of two ways. For example:</FONT>
# axis_cget(<FONT COLOR="#009900">'x'</FONT>, <FONT COLOR="#009900">'justify'</FONT>)
<FONT COLOR="#DD0000"># or</FONT>
# xaxis_cget(<FONT COLOR="#009900">'justify'</FONT>)
<STRONG> def axis_cget</STRONG>(self, axis, key):
return self.tk.call(self._w, axis + <FONT COLOR="#009900">'axis'</FONT>, <FONT COLOR="#009900">'cget'</FONT>, <FONT COLOR="#009900">'-'</FONT> + key)
<STRONG> def axis_configure</STRONG>(self, axis, option=None, **kw):
subcommand = (self._w, axis + <FONT COLOR="#009900">'axis'</FONT>, <FONT COLOR="#009900">'configure'</FONT>)
return self._configure(subcommand, option, kw)
<STRONG> def axis_invtransform</STRONG>(self, axis, value):
return self.tk.getdouble(self.tk.call(
self._w, axis + <FONT COLOR="#009900">'axis'</FONT>, <FONT COLOR="#009900">'invtransform'</FONT>, value))
<STRONG> def axis_limits</STRONG>(self, axis):
return self._getdoubles(self.tk.call(
self._w, axis + <FONT COLOR="#009900">'axis'</FONT>, <FONT COLOR="#009900">'limits'</FONT>))
<STRONG> def axis_transform</STRONG>(self, axis, value):
return self.tk.getint(self.tk.call(
self._w, axis + <FONT COLOR="#009900">'axis'</FONT>, <FONT COLOR="#009900">'transform'</FONT>, value))
<STRONG> def xaxis_cget</STRONG>(self, key):
return self.axis_cget(<FONT COLOR="#009900">'x'</FONT>, key)
<STRONG> def xaxis_configure</STRONG>(self, option=None, **kw):
return apply(self.axis_configure, (<FONT COLOR="#009900">'x'</FONT>, option), kw)
<STRONG> def xaxis_invtransform</STRONG>(self, value):
return self.axis_invtransform(<FONT COLOR="#009900">'x'</FONT>, value)
<STRONG> def xaxis_limits</STRONG>(self):
return self.axis_limits(<FONT COLOR="#009900">'x'</FONT>)
<STRONG> def xaxis_transform</STRONG>(self, value):
return self.axis_transform(<FONT COLOR="#009900">'x'</FONT>, value)
<STRONG> def x2axis_cget</STRONG>(self, key):
return self.axis_cget(<FONT COLOR="#009900">'x2'</FONT>, key)
<STRONG> def x2axis_configure</STRONG>(self, option=None, **kw):
return apply(self.axis_configure, (<FONT COLOR="#009900">'x2'</FONT>, option), kw)
<STRONG> def x2axis_invtransform</STRONG>(self, value):
return self.axis_invtransform(<FONT COLOR="#009900">'x2'</FONT>, value)
<STRONG> def x2axis_limits</STRONG>(self):
return self.axis_limits(<FONT COLOR="#009900">'x2'</FONT>)
<STRONG> def x2axis_transform</STRONG>(self, value):
return self.axis_transform(<FONT COLOR="#009900">'x2'</FONT>, value)
<STRONG> def yaxis_cget</STRONG>(self, key):
return self.axis_cget(<FONT COLOR="#009900">'y'</FONT>, key)
<STRONG> def yaxis_configure</STRONG>(self, option=None, **kw):
return apply(self.axis_configure, (<FONT COLOR="#009900">'y'</FONT>, option), kw)
<STRONG> def yaxis_invtransform</STRONG>(self, value):
return self.axis_invtransform(<FONT COLOR="#009900">'y'</FONT>, value)
<STRONG> def yaxis_limits</STRONG>(self):
return self.axis_limits(<FONT COLOR="#009900">'y'</FONT>)
<STRONG> def yaxis_transform</STRONG>(self, value):
return self.axis_transform(<FONT COLOR="#009900">'y'</FONT>, value)
<STRONG> def y2axis_cget</STRONG>(self, key):
return self.axis_cget(<FONT COLOR="#009900">'y2'</FONT>, key)
<STRONG> def y2axis_configure</STRONG>(self, option=None, **kw):
return apply(self.axis_configure, (<FONT COLOR="#009900">'y2'</FONT>, option), kw)
<STRONG> def y2axis_invtransform</STRONG>(self, value):
return self.axis_invtransform(<FONT COLOR="#009900">'y2'</FONT>, value)
<STRONG> def y2axis_limits</STRONG>(self):
return self.axis_limits(<FONT COLOR="#009900">'y2'</FONT>)
<STRONG> def y2axis_transform</STRONG>(self, value):
return self.axis_transform(<FONT COLOR="#009900">'y2'</FONT>, value)
<STRONG> def crosshairs_cget</STRONG>(self, key):
return self.tk.call(self._w, <FONT COLOR="#009900">'crosshairs'</FONT>, <FONT COLOR="#009900">'cget'</FONT>, <FONT COLOR="#009900">'-'</FONT> + key)
<STRONG> def crosshairs_configure</STRONG>(self, option=None, **kw):
subcommand = (self._w, <FONT COLOR="#009900">'crosshairs'</FONT>, <FONT COLOR="#009900">'configure'</FONT>)
return self._configure(subcommand, option, kw)
<STRONG> def crosshairs_off</STRONG>(self):
self.tk.call(self._w, <FONT COLOR="#009900">'crosshairs'</FONT>, <FONT COLOR="#009900">'off'</FONT>)
<STRONG> def crosshairs_on</STRONG>(self):
self.tk.call(self._w, <FONT COLOR="#009900">'crosshairs'</FONT>, <FONT COLOR="#009900">'on'</FONT>)
<STRONG> def crosshairs_toggle</STRONG>(self):
self.tk.call(self._w, <FONT COLOR="#009900">'crosshairs'</FONT>, <FONT COLOR="#009900">'toggle'</FONT>)
<STRONG> def element_activate</STRONG>(self, name, *args):
apply(self.tk.call, (self._w, <FONT COLOR="#009900">'element'</FONT>, <FONT COLOR="#009900">'activate'</FONT>, name) + args)
<STRONG> def element_bar</STRONG>(self, name, **kw):
apply(self.tk.call,
(self._w, <FONT COLOR="#009900">'element'</FONT>, <FONT COLOR="#009900">'bar'</FONT>, name) + self._options(kw))
<STRONG> def element_cget</STRONG>(self, name, key):
return self.tk.call(self._w, <FONT COLOR="#009900">'element'</FONT>, <FONT COLOR="#009900">'cget'</FONT>, name, <FONT COLOR="#009900">'-'</FONT> + key)
<STRONG> def element_closest</STRONG>(self, x, y, *args, **kw):
success = self.tk.getint(apply(self.tk.call,
(self._w, <FONT COLOR="#009900">'element'</FONT>, <FONT COLOR="#009900">'closest'</FONT>, x, y, <FONT COLOR="#009900">'python_private_1'</FONT>) +
args + self._options(kw)))
if success:
rtn = {}
rtn[<FONT COLOR="#009900">'dist'</FONT>] = self.tk.getdouble(self.tk.globalgetvar(<FONT COLOR="#009900">'python_private_1'</FONT>, <FONT COLOR="#009900">'dist'</FONT>))
rtn[<FONT COLOR="#009900">'x'</FONT>] = self.tk.getdouble(self.tk.globalgetvar(<FONT COLOR="#009900">'python_private_1'</FONT>, <FONT COLOR="#009900">'x'</FONT>))
rtn[<FONT COLOR="#009900">'y'</FONT>] = self.tk.getdouble(self.tk.globalgetvar(<FONT COLOR="#009900">'python_private_1'</FONT>, <FONT COLOR="#009900">'y'</FONT>))
rtn[<FONT COLOR="#009900">'index'</FONT>] = self.tk.getint(self.tk.globalgetvar(<FONT COLOR="#009900">'python_private_1'</FONT>, <FONT COLOR="#009900">'index'</FONT>))
rtn[<FONT COLOR="#009900">'name'</FONT>] = self.tk.globalgetvar(<FONT COLOR="#009900">'python_private_1'</FONT>, <FONT COLOR="#009900">'name'</FONT>)
return rtn
else:
return None
<STRONG> def element_configure</STRONG>(self, name, option=None, **kw):
subcommand = (self._w, <FONT COLOR="#009900">'element'</FONT>, <FONT COLOR="#009900">'configure'</FONT>, name)
return self._configure(subcommand, option, kw)
<STRONG> def element_create</STRONG>(self, name, **kw):
apply(self.tk.call,
(self._w, <FONT COLOR="#009900">'element'</FONT>, <FONT COLOR="#009900">'create'</FONT>, name) + self._options(kw))
<STRONG> def element_deactivate</STRONG>(self, *args):
apply(self.tk.call, (self._w, <FONT COLOR="#009900">'element'</FONT>, <FONT COLOR="#009900">'deactivate'</FONT>) + args)
<STRONG> def element_delete</STRONG>(self, *args):
apply(self.tk.call, (self._w, <FONT COLOR="#009900">'element'</FONT>, <FONT COLOR="#009900">'delete'</FONT>) + args)
<STRONG> def element_exists</STRONG>(self, name):
return self.tk.getboolean(
self.tk.call(self._w, <FONT COLOR="#009900">'element'</FONT>, <FONT COLOR="#009900">'exists'</FONT>, name))
<STRONG> def element_line</STRONG>(self, name, **kw):
apply(self.tk.call,
(self._w, <FONT COLOR="#009900">'element'</FONT>, <FONT COLOR="#009900">'line'</FONT>, name) + self._options(kw))
<STRONG> def element_names</STRONG>(self):
return self.tk.splitlist(self.tk.call(self._w, <FONT COLOR="#009900">'element'</FONT>, <FONT COLOR="#009900">'names'</FONT>))
<STRONG> def element_show</STRONG>(self, nameList=None):
if nameList is not None:
nameList = tuple(nameList)
return self.tk.splitlist(
self.tk.call(self._w, <FONT COLOR="#009900">'element'</FONT>, <FONT COLOR="#009900">'show'</FONT>, nameList))
<STRONG> def element_type</STRONG>(self, name):
return self.tk.call(self._w, <FONT COLOR="#009900">'element'</FONT>, <FONT COLOR="#009900">'type'</FONT>, name)
<STRONG> def grid_cget</STRONG>(self, key):
return self.tk.call(self._w, <FONT COLOR="#009900">'grid'</FONT>, <FONT COLOR="#009900">'cget'</FONT>, <FONT COLOR="#009900">'-'</FONT> + key)
<STRONG> def grid_configure</STRONG>(self, option=None, **kw):
subcommand = (self._w, <FONT COLOR="#009900">'grid'</FONT>, <FONT COLOR="#009900">'configure'</FONT>)
return self._configure(subcommand, option, kw)
<STRONG> def grid_off</STRONG>(self):
self.tk.call(self._w, <FONT COLOR="#009900">'grid'</FONT>, <FONT COLOR="#009900">'off'</FONT>)
<STRONG> def grid_on</STRONG>(self):
self.tk.call(self._w, <FONT COLOR="#009900">'grid'</FONT>, <FONT COLOR="#009900">'on'</FONT>)
<STRONG> def grid_toggle</STRONG>(self):
self.tk.call(self._w, <FONT COLOR="#009900">'grid'</FONT>, <FONT COLOR="#009900">'toggle'</FONT>)
<STRONG> def legend_activate</STRONG>(self, *args):
apply(self.tk.call, (self._w, <FONT COLOR="#009900">'legend'</FONT>, <FONT COLOR="#009900">'activate'</FONT>) + args)
<STRONG> def legend_cget</STRONG>(self, key):
return self.tk.call(self._w, <FONT COLOR="#009900">'legend'</FONT>, <FONT COLOR="#009900">'cget'</FONT>, <FONT COLOR="#009900">'-'</FONT> + key)
<STRONG> def legend_configure</STRONG>(self, option=None, **kw):
subcommand = (self._w, <FONT COLOR="#009900">'legend'</FONT>, <FONT COLOR="#009900">'configure'</FONT>)
return self._configure(subcommand, option, kw)
<STRONG> def legend_deactivate</STRONG>(self, *args):
apply(self.tk.call, (self._w, <FONT COLOR="#009900">'legend'</FONT>, <FONT COLOR="#009900">'deactivate'</FONT>) + args)
<STRONG> def legend_get</STRONG>(self, pos):
return self.tk.call(self._w, <FONT COLOR="#009900">'legend'</FONT>, <FONT COLOR="#009900">'get'</FONT>, pos)
<STRONG> def postscript_cget</STRONG>(self, key):
return self.tk.call(self._w, <FONT COLOR="#009900">'postscript'</FONT>, <FONT COLOR="#009900">'cget'</FONT>, <FONT COLOR="#009900">'-'</FONT> + key)
<STRONG> def postscript_configure</STRONG>(self, option=None, **kw):
subcommand = (self._w, <FONT COLOR="#009900">'postscript'</FONT>, <FONT COLOR="#009900">'configure'</FONT>)
return self._configure(subcommand, option, kw)
<STRONG> def postscript_output</STRONG>(self, fileName=None, **kw):
prefix = (self._w, <FONT COLOR="#009900">'postscript'</FONT>, <FONT COLOR="#009900">'output'</FONT>)
if fileName is None:
return apply(self.tk.call, prefix + self._options(kw))
else:
apply(self.tk.call, prefix + (fileName,) + self._options(kw))
<STRONG> def marker_after</STRONG>(self, first, second=None):
self.tk.call(self._w, <FONT COLOR="#009900">'marker'</FONT>, <FONT COLOR="#009900">'after'</FONT>, first, second)
<STRONG> def marker_before</STRONG>(self, first, second=None):
self.tk.call(self._w, <FONT COLOR="#009900">'marker'</FONT>, <FONT COLOR="#009900">'before'</FONT>, first, second)
<STRONG> def marker_cget</STRONG>(self, name, key):
return self.tk.call(self._w, <FONT COLOR="#009900">'marker'</FONT>, <FONT COLOR="#009900">'cget'</FONT>, name, <FONT COLOR="#009900">'-'</FONT> + key)
<STRONG> def marker_configure</STRONG>(self, name, option=None, **kw):
subcommand = (self._w, <FONT COLOR="#009900">'marker'</FONT>, <FONT COLOR="#009900">'configure'</FONT>, name)
return self._configure(subcommand, option, kw)
<STRONG> def marker_create</STRONG>(self, type, **kw):
return apply(self.tk.call,
(self._w, <FONT COLOR="#009900">'marker'</FONT>, <FONT COLOR="#009900">'create'</FONT>, type) + self._options(kw))
<STRONG> def marker_delete</STRONG>(self, *args):
apply(self.tk.call, (self._w, <FONT COLOR="#009900">'marker'</FONT>, <FONT COLOR="#009900">'delete'</FONT>) + args)
<STRONG> def marker_exists</STRONG>(self, name):
return self.tk.getboolean(
self.tk.call(self._w, <FONT COLOR="#009900">'marker'</FONT>, <FONT COLOR="#009900">'exists'</FONT>, name))
<STRONG> def marker_names</STRONG>(self, pattern=None):
return self.tk.splitlist(
self.tk.call(self._w, <FONT COLOR="#009900">'marker'</FONT>, <FONT COLOR="#009900">'names'</FONT>, pattern))
<STRONG> def marker_type</STRONG>(self, name):
type = self.tk.call(self._w, <FONT COLOR="#009900">'marker'</FONT>, <FONT COLOR="#009900">'type'</FONT>, name)
if type == <FONT COLOR="#009900">''</FONT>:
type = None
return type
</PRE>
</BODY> </HTML>
|