diff options
author | Guido van Rossum <guido@python.org> | 1995-09-07 19:59:22 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-09-07 19:59:22 (GMT) |
commit | 502d96021b67bd68ab75dc0f39a2e1a5d4b1d87b (patch) | |
tree | 580c8ccaab0a7254788a334c43633f3b05543e23 /Demo/tkinter/guido | |
parent | c27e04228cecabcff012e6ef1c378c0dd82d5c3c (diff) | |
download | cpython-502d96021b67bd68ab75dc0f39a2e1a5d4b1d87b.zip cpython-502d96021b67bd68ab75dc0f39a2e1a5d4b1d87b.tar.gz cpython-502d96021b67bd68ab75dc0f39a2e1a5d4b1d87b.tar.bz2 |
incompletely converted to Tk 4.0
Diffstat (limited to 'Demo/tkinter/guido')
-rwxr-xr-x | Demo/tkinter/guido/svkill.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Demo/tkinter/guido/svkill.py b/Demo/tkinter/guido/svkill.py index ed8a0a7..2881afd 100755 --- a/Demo/tkinter/guido/svkill.py +++ b/Demo/tkinter/guido/svkill.py @@ -1,8 +1,12 @@ #! /usr/local/bin/python -# Tkinter interface to SYSV `kill' command. +# Tkinter interface to SYSV `ps' and `kill' commands. from Tkinter import * + +if TkVersion < 4.0: + raise ImportError, "This version of svkill requires Tk 4.0 or later" + from string import splitfields from string import split import commands @@ -11,9 +15,9 @@ import os user = os.environ['LOGNAME'] class BarButton(Menubutton): - _CNF = {Pack: {'side': 'left'}} def __init__(self, master=None, cnf={}): - Menubutton.__init__(self, master, (self._CNF, cnf)) + Menubutton.__init__(self, master, cnf) + self.pack(side='left') self.menu = Menu(self, {'name': 'menu'}) self['menu'] = self.menu @@ -46,15 +50,14 @@ class Kill(Frame): list = splitfields(s, '\n') self.header.set(list[0] + ' ') del list[0] - y = self.frame.vscroll.get()[2] self.frame.list.delete(0, AtEnd()) for line in list: self.frame.list.insert(0, line) - self.frame.list.yview(y) def do_motion(self, e): - e.widget.select_from(e.widget.nearest(e.y)) + e.widget.select_clear('0', 'end') + e.widget.select_set(e.widget.nearest(e.y)) def do_leave(self, e): - e.widget.select_clear() + e.widget.select_clear('0', 'end') def do_1(self, e): self.kill(e.widget.get(e.widget.nearest(e.y))) def __init__(self, master=None, cnf={}): @@ -117,9 +120,10 @@ class Kill(Frame): self.frame, {'relief': 'sunken', 'font': '*-Courier-Medium-R-Normal-*-120-*', - 'geometry': '40x10', + 'width': 40, 'height': 10, 'selectbackground': '#eed5b7', 'selectborderwidth': 0, + 'selectmode': 'browse', 'yscroll': self.frame.vscroll.set}) self.frame.vscroll['command'] = self.frame.list.yview self.frame.vscroll.pack({'side': 'right', 'fill': 'y'}) |