summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Mullender <sjoerd@acm.org>1993-10-01 14:29:45 (GMT)
committerSjoerd Mullender <sjoerd@acm.org>1993-10-01 14:29:45 (GMT)
commit148644d5ac57826a8135b20e791062805c4fb046 (patch)
treefeaec131c0981551722f5b66af9d5b031e3cf11c
parent72d73649ffdea4ef6038d3fc9417c860ac1ff4e4 (diff)
downloadcpython-148644d5ac57826a8135b20e791062805c4fb046.zip
cpython-148644d5ac57826a8135b20e791062805c4fb046.tar.gz
cpython-148644d5ac57826a8135b20e791062805c4fb046.tar.bz2
WDB enhancement: Click once on a line with a class instance in the
local or global variables list and you get a window with the instance variable of the class instance. This list is of course automatically kept up to date.
-rw-r--r--Lib/lib-stdwin/wdbframewin.py24
-rwxr-xr-xLib/stdwin/wdbframewin.py24
2 files changed, 48 insertions, 0 deletions
diff --git a/Lib/lib-stdwin/wdbframewin.py b/Lib/lib-stdwin/wdbframewin.py
index 9e21365..3a7f6fe 100644
--- a/Lib/lib-stdwin/wdbframewin.py
+++ b/Lib/lib-stdwin/wdbframewin.py
@@ -61,6 +61,30 @@ class FrameWindow(basewin.BaseWindow):
dummy = self.editor.event(WE_COMMAND, \
self.win, detail)
+ def mouse_down(self, detail):
+ (h, v), clicks, button, mask = detail
+ i = v / stdwin.lineheight()
+ if 5 <= i < len(self.displaylist):
+ import string
+ name = string.splitfields(self.displaylist[i],' = ')[0]
+ if not self.dict.has_key(name):
+ stdwin.fleep()
+ return
+ value = self.dict[name]
+ if not hasattr(value, '__dict__'):
+ stdwin.fleep()
+ return
+ name = 'instance ' + `value`
+ if self.debugger.framewindows.has_key(name):
+ self.debugger.framewindows[name].popup()
+ else:
+ self.debugger.framewindows[name] = \
+ FrameWindow().init(self.debugger,
+ self.frame, value.__dict__,
+ name)
+ return
+ stdwin.fleep()
+
def re_eval(self):
import string, repr
expr = string.strip(self.editor.gettext())
diff --git a/Lib/stdwin/wdbframewin.py b/Lib/stdwin/wdbframewin.py
index 9e21365..3a7f6fe 100755
--- a/Lib/stdwin/wdbframewin.py
+++ b/Lib/stdwin/wdbframewin.py
@@ -61,6 +61,30 @@ class FrameWindow(basewin.BaseWindow):
dummy = self.editor.event(WE_COMMAND, \
self.win, detail)
+ def mouse_down(self, detail):
+ (h, v), clicks, button, mask = detail
+ i = v / stdwin.lineheight()
+ if 5 <= i < len(self.displaylist):
+ import string
+ name = string.splitfields(self.displaylist[i],' = ')[0]
+ if not self.dict.has_key(name):
+ stdwin.fleep()
+ return
+ value = self.dict[name]
+ if not hasattr(value, '__dict__'):
+ stdwin.fleep()
+ return
+ name = 'instance ' + `value`
+ if self.debugger.framewindows.has_key(name):
+ self.debugger.framewindows[name].popup()
+ else:
+ self.debugger.framewindows[name] = \
+ FrameWindow().init(self.debugger,
+ self.frame, value.__dict__,
+ name)
+ return
+ stdwin.fleep()
+
def re_eval(self):
import string, repr
expr = string.strip(self.editor.gettext())