mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
#3018: tkinter demo fixes for py3k.
This commit is contained in:
parent
07e4f1565b
commit
856023a098
18 changed files with 196 additions and 179 deletions
|
@ -2,11 +2,11 @@
|
|||
|
||||
# Tk man page browser -- currently only shows the Tcl/Tk man pages
|
||||
|
||||
import sys
|
||||
import os
|
||||
import string
|
||||
import re
|
||||
import sys
|
||||
from tkinter import *
|
||||
|
||||
from ManPage import ManPage
|
||||
|
||||
MANNDIRLIST = ['/depot/sundry/man/mann','/usr/local/man/mann']
|
||||
|
@ -221,9 +221,9 @@ class SelectionBox:
|
|||
print('Regex error:', msg)
|
||||
return
|
||||
here = self.text.index(AtInsert())
|
||||
lineno = string.atoi(here[:string.find(here, '.')])
|
||||
lineno = int(here[:here.find('.')])
|
||||
end = self.text.index(AtEnd())
|
||||
endlineno = string.atoi(end[:string.find(end, '.')])
|
||||
endlineno = int(end[:end.find('.')])
|
||||
wraplineno = lineno
|
||||
found = 0
|
||||
while 1:
|
||||
|
@ -237,9 +237,9 @@ class SelectionBox:
|
|||
line = self.text.get('%d.0 linestart' % lineno,
|
||||
'%d.0 lineend' % lineno)
|
||||
i = prog.search(line)
|
||||
if i >= 0:
|
||||
if i:
|
||||
found = 1
|
||||
n = max(1, len(prog.group(0)))
|
||||
n = max(1, len(i.group(0)))
|
||||
try:
|
||||
self.text.tag_remove('sel',
|
||||
AtSelFirst(),
|
||||
|
@ -247,10 +247,10 @@ class SelectionBox:
|
|||
except TclError:
|
||||
pass
|
||||
self.text.tag_add('sel',
|
||||
'%d.%d' % (lineno, i),
|
||||
'%d.%d' % (lineno, i+n))
|
||||
'%d.%d' % (lineno, i.start()),
|
||||
'%d.%d' % (lineno, i.start()+n))
|
||||
self.text.mark_set(AtInsert(),
|
||||
'%d.%d' % (lineno, i))
|
||||
'%d.%d' % (lineno, i.start()))
|
||||
self.text.yview_pickplace(AtInsert())
|
||||
break
|
||||
if not found:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue