summaryrefslogtreecommitdiffstats
path: root/Tools/idle/PyShell.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-01-28 22:02:47 (GMT)
committerGuido van Rossum <guido@python.org>1999-01-28 22:02:47 (GMT)
commit07ec8967078a966365a44db301a9063f70c7f474 (patch)
treef97b034c2f3489958e47ae03a3cb41c5312a745c /Tools/idle/PyShell.py
parent85ef9dce9f4b1982c1f26daa0fe9f4af08e124a6 (diff)
downloadcpython-07ec8967078a966365a44db301a9063f70c7f474.zip
cpython-07ec8967078a966365a44db301a9063f70c7f474.tar.gz
cpython-07ec8967078a966365a44db301a9063f70c7f474.tar.bz2
Move menu/key binding code from Bindings.py to EditorWindow.py,
with changed APIs -- it makes much more sense there. Also add a new feature: if the first character of a menu label is a '!', it gets a checkbox. Checkboxes are bound to Boolean Tcl variables that can be accessed through the new getvar/setvar/getrawvar API; the variable is named after the event to which the menu is bound.
Diffstat (limited to 'Tools/idle/PyShell.py')
-rw-r--r--Tools/idle/PyShell.py29
1 files changed, 17 insertions, 12 deletions
diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py
index f484fb8..115d96f 100644
--- a/Tools/idle/PyShell.py
+++ b/Tools/idle/PyShell.py
@@ -217,11 +217,11 @@ class ModifiedInterpreter(InteractiveInterpreter):
raise
else:
self.showtraceback()
- if self.tkconsole.jit_stack_view:
+ if self.tkconsole.getvar("<<toggle-jit-stack-viewer>>"):
self.tkconsole.open_stack_viewer()
except:
self.showtraceback()
- if self.tkconsole.jit_stack_view:
+ if self.tkconsole.getvar("<<toggle-jit-stack-viewer>>"):
self.tkconsole.open_stack_viewer()
finally:
@@ -289,17 +289,20 @@ class PyShell(OutputWindow):
tkMessageBox.showerror("Don't debug now",
"You can only toggle the debugger when idle",
master=self.text)
+ self.set_debugger_indicator()
return "break"
- db = self.interp.getdebugger()
- if db:
- self.close_debugger()
else:
- self.open_debugger()
-
- jit_stack_view = 0
-
+ db = self.interp.getdebugger()
+ if db:
+ self.close_debugger()
+ else:
+ self.open_debugger()
+
+ def set_debugger_indicator(self):
+ db = self.interp.getdebugger()
+ self.setvar("<<toggle-debugger>>", not not db)
def toggle_jit_stack_viewer( self, event=None):
- self.jit_stack_view = not self.jit_stack_view
+ pass # All we need is the variable
def close_debugger(self):
db = self.interp.getdebugger()
@@ -310,12 +313,14 @@ class PyShell(OutputWindow):
self.console.write("[DEBUG OFF]\n")
sys.ps1 = ">>> "
self.showprompt()
+ self.set_debugger_indicator()
def open_debugger(self):
import Debugger
self.interp.setdebugger(Debugger.Debugger(self))
sys.ps1 = "[DEBUG ON]\n>>> "
self.showprompt()
+ self.set_debugger_indicator()
def beginexecuting(self):
# Helper for ModifiedInterpreter
@@ -335,8 +340,8 @@ class PyShell(OutputWindow):
if self.executing:
# XXX Need to ask a question here
if not tkMessageBox.askokcancel(
- "Cancel?",
- "The program is still running; do you want to cancel it?",
+ "Kill?",
+ "The program is still running; do you want to kill it?",
default="ok",
master=self.text):
return "cancel"