1. If user passes a non-existant filename on the commandline, just open
a new file, don't raise a dialog. IDLEfork 954928. 2. Refactor EditorWindow.wakeup() to WindowList.ListedToplevel.wakeup() and clarify that the Toplevel of an EditorWindow is a WindowList.ListedToplevel. 3. Make a number of improvements to keyboard focus binding. Improve window raising, especially in the debugger. IDLEfork Bug 763524 (GvR list). 4. Bump idlever to 1.1a3 M Debugger.py M EditorWindow.py M FileList.py M NEWS.txt M PyShell.py M WindowList.py M idlever.py
This commit is contained in:
parent
e594bee535
commit
183403a271
|
@ -84,7 +84,7 @@ class Debugger:
|
|||
pyshell = self.pyshell
|
||||
self.flist = pyshell.flist
|
||||
self.root = root = pyshell.root
|
||||
self.top = top =ListedToplevel(root)
|
||||
self.top = top = ListedToplevel(root)
|
||||
self.top.wm_title("Debug Control")
|
||||
self.top.wm_iconname("Debug")
|
||||
top.wm_protocol("WM_DELETE_WINDOW", self.close)
|
||||
|
@ -155,7 +155,6 @@ class Debugger:
|
|||
if self.vglobals.get():
|
||||
self.show_globals()
|
||||
|
||||
|
||||
def interaction(self, message, frame, info=None):
|
||||
self.frame = frame
|
||||
self.status.configure(text=message)
|
||||
|
@ -191,7 +190,7 @@ class Debugger:
|
|||
for b in self.buttons:
|
||||
b.configure(state="normal")
|
||||
#
|
||||
self.top.tkraise()
|
||||
self.top.wakeup()
|
||||
self.root.mainloop()
|
||||
#
|
||||
for b in self.buttons:
|
||||
|
|
|
@ -75,7 +75,7 @@ class EditorWindow:
|
|||
root = root or flist.root
|
||||
self.root = root
|
||||
self.menubar = Menu(root)
|
||||
self.top = top = self.Toplevel(root, menu=self.menubar)
|
||||
self.top = top = WindowList.ListedToplevel(root, menu=self.menubar)
|
||||
if flist:
|
||||
self.tkinter_vars = flist.vars
|
||||
#self.top.instance_dict makes flist.inversedict avalable to
|
||||
|
@ -102,6 +102,7 @@ class EditorWindow:
|
|||
'cursor',fgBg='fg'),
|
||||
width=self.width,
|
||||
height=idleConf.GetOption('main','EditorWindow','height') )
|
||||
self.top.focused_widget = self.text
|
||||
|
||||
self.createmenubar()
|
||||
self.apply_bindings()
|
||||
|
@ -236,13 +237,6 @@ class EditorWindow:
|
|||
self.status_bar.set_label('column', 'Col: %s' % column)
|
||||
self.status_bar.set_label('line', 'Ln: %s' % line)
|
||||
|
||||
def wakeup(self):
|
||||
if self.top.wm_state() == "iconic":
|
||||
self.top.wm_deiconify()
|
||||
else:
|
||||
self.top.tkraise()
|
||||
self.text.focus_set()
|
||||
|
||||
menu_specs = [
|
||||
("file", "_File"),
|
||||
("edit", "_Edit"),
|
||||
|
|
|
@ -1,27 +1,12 @@
|
|||
# changes by dscherer@cmu.edu
|
||||
# - FileList.open() takes an optional 3rd parameter action, which is
|
||||
# called instead of creating a new EditorWindow. This enables
|
||||
# things like 'open in same window'.
|
||||
|
||||
import os
|
||||
from Tkinter import *
|
||||
import tkMessageBox
|
||||
|
||||
import WindowList
|
||||
|
||||
#$ event <<open-new-window>>
|
||||
#$ win <Control-n>
|
||||
#$ unix <Control-x><Control-n>
|
||||
|
||||
# (This is labeled as 'Exit'in the File menu)
|
||||
#$ event <<close-all-windows>>
|
||||
#$ win <Control-q>
|
||||
#$ unix <Control-x><Control-c>
|
||||
|
||||
class FileList:
|
||||
|
||||
from EditorWindow import EditorWindow
|
||||
EditorWindow.Toplevel = WindowList.ListedToplevel # XXX Patch it!
|
||||
from EditorWindow import EditorWindow # class variable, may be overridden
|
||||
# e.g. by PyShellFileList
|
||||
|
||||
def __init__(self, root):
|
||||
self.root = root
|
||||
|
@ -33,25 +18,22 @@ class FileList:
|
|||
assert filename
|
||||
filename = self.canonize(filename)
|
||||
if os.path.isdir(filename):
|
||||
# This can happen when bad filename is passed on command line:
|
||||
tkMessageBox.showerror(
|
||||
"Is A Directory",
|
||||
"The path %r is a directory." % (filename,),
|
||||
"File Error",
|
||||
"%r is a directory." % (filename,),
|
||||
master=self.root)
|
||||
return None
|
||||
key = os.path.normcase(filename)
|
||||
if self.dict.has_key(key):
|
||||
edit = self.dict[key]
|
||||
edit.wakeup()
|
||||
edit.top.wakeup()
|
||||
return edit
|
||||
if not os.path.exists(filename):
|
||||
tkMessageBox.showinfo(
|
||||
"New File",
|
||||
"Opening non-existent file %r" % (filename,),
|
||||
master=self.root)
|
||||
if action is None:
|
||||
return self.EditorWindow(self, filename, key)
|
||||
else:
|
||||
if action:
|
||||
# Don't create window, perform 'action', e.g. open in same window
|
||||
return action(filename)
|
||||
else:
|
||||
return self.EditorWindow(self, filename, key)
|
||||
|
||||
def gotofileline(self, filename, lineno=None):
|
||||
edit = self.open(filename)
|
||||
|
|
|
@ -1,8 +1,24 @@
|
|||
What's New in IDLE 1.1a3?
|
||||
=========================
|
||||
|
||||
*Release date: 02-SEP-2004*
|
||||
|
||||
- Improve keyboard focus binding, especially in Windows menu. Improve
|
||||
window raising, especially in the Windows menu and in the debugger.
|
||||
IDLEfork 763524.
|
||||
|
||||
- If user passes a non-existant filename on the commandline, just
|
||||
open a new file, don't raise a dialog. IDLEfork 854928.
|
||||
|
||||
|
||||
What's New in IDLE 1.1a2?
|
||||
=========================
|
||||
|
||||
*Release date: 05-AUG-2004*
|
||||
|
||||
- EditorWindow.py was not finding the .chm help file on Windows. Typo
|
||||
at Rev 1.54. Python Bug 990954
|
||||
|
||||
- checking sys.platform for substring 'win' was breaking IDLE docs on Mac
|
||||
(darwin). Also, Mac Safari browser requires full file:// URIs. SF 900580.
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ linecache.checkcache = extended_linecache_checkcache
|
|||
|
||||
|
||||
class PyShellEditorWindow(EditorWindow):
|
||||
"Regular text edit window when a shell is present"
|
||||
"Regular text edit window in IDLE, supports breakpoints"
|
||||
|
||||
def __init__(self, *args):
|
||||
self.breakpoints = []
|
||||
|
@ -258,15 +258,17 @@ class PyShellEditorWindow(EditorWindow):
|
|||
|
||||
|
||||
class PyShellFileList(FileList):
|
||||
"Extend base class: file list when a shell is present"
|
||||
"Extend base class: IDLE supports a shell and breakpoints"
|
||||
|
||||
# override FileList's class variable, instances return PyShellEditorWindow
|
||||
# instead of EditorWindow when new edit windows are created.
|
||||
EditorWindow = PyShellEditorWindow
|
||||
|
||||
pyshell = None
|
||||
|
||||
def open_shell(self, event=None):
|
||||
if self.pyshell:
|
||||
self.pyshell.wakeup()
|
||||
self.pyshell.top.wakeup()
|
||||
else:
|
||||
self.pyshell = PyShell(self)
|
||||
if self.pyshell:
|
||||
|
@ -802,7 +804,6 @@ class PyShell(OutputWindow):
|
|||
text.bind("<<end-of-file>>", self.eof_callback)
|
||||
text.bind("<<open-stack-viewer>>", self.open_stack_viewer)
|
||||
text.bind("<<toggle-debugger>>", self.toggle_debugger)
|
||||
text.bind("<<open-python-shell>>", self.flist.open_shell)
|
||||
text.bind("<<toggle-jit-stack-viewer>>", self.toggle_jit_stack_viewer)
|
||||
if use_subprocess:
|
||||
text.bind("<<view-restart>>", self.view_restart_mark)
|
||||
|
|
|
@ -60,6 +60,7 @@ class ListedToplevel(Toplevel):
|
|||
def __init__(self, master, **kw):
|
||||
Toplevel.__init__(self, master, kw)
|
||||
registry.add(self)
|
||||
self.focused_widget = self
|
||||
|
||||
def destroy(self):
|
||||
registry.delete(self)
|
||||
|
@ -79,10 +80,10 @@ class ListedToplevel(Toplevel):
|
|||
def wakeup(self):
|
||||
try:
|
||||
if self.wm_state() == "iconic":
|
||||
self.wm_withdraw()
|
||||
self.wm_deiconify()
|
||||
else:
|
||||
self.tkraise()
|
||||
self.focus_set()
|
||||
self.tkraise()
|
||||
self.focused_widget.focus_set()
|
||||
except TclError:
|
||||
# This can happen when the window menu was torn off.
|
||||
# Simply ignore it.
|
||||
|
|
|
@ -1 +1 @@
|
|||
IDLE_VERSION = "1.1a2"
|
||||
IDLE_VERSION = "1.1a3"
|
||||
|
|
Loading…
Reference in New Issue