14 import BreakpointsFrame
19 class StatusWindow (gtk
.Window
):
21 def __init__(self
, mainctrlwnd
, debugger
):
23 gtk
.Window
.__init
__(self
)
24 self
.debugger
= debugger
26 self
.set_border_width(5)
27 self
.set_title("Status")
28 self
.set_default_size(400,600)
29 self
.connect("destroy", DbgTerminal
.quitHandler
)
31 vbox
= gtk
.VBox(False, 5)
34 hbox
= gtk
.HBox(False, 5)
35 vbox
.pack_start(hbox
, False, False)
37 self
.viewBtn
= gtk
.Button("View")
38 self
.viewBtn
.connect("clicked", self
.viewBtnClicked
)
39 hbox
.pack_start(self
.viewBtn
, False, False)
40 self
.status
= gtk
.Label("Not Running")
41 hbox
.pack_start(self
.status
, False, False)
43 self
.paned1
= gtk
.VPaned()
48 self
.frames
+= [WatchesFrame
.WatchesFrame(debugger
)]
49 self
.frames
+= [BreakpointsFrame
.BreakpointsFrame(debugger
)]
50 self
.paned1
.add1(self
.frames
[0])
51 self
.paned1
.add2(self
.frames
[1])
53 #Register callback function for new positions
54 #and update the values
55 mainctrlwnd
.newPosCbs
+= [self
.updateValues
]
60 def applyConfiguration(self
, conf
):
62 w
= conf
.findInt("statuswnd-width")
63 h
= conf
.findInt("statuswnd-height")
64 paned1
= conf
.findInt("statuswnd-paned1")
66 if w
!=None and h
!=None:
69 self
.paned1
.set_position(paned1
)
72 while not self
.debugger
.isActive():
76 f
.applyConfiguration(conf
)
79 def fillConfiguration(self
, conf
):
81 conf
.addInt("statuswnd-width", self
.get_size()[0])
82 conf
.addInt("statuswnd-height", self
.get_size()[1])
83 conf
.addInt("statuswnd-paned1", self
.paned1
.get_position())
86 f
.fillConfiguration(conf
)
89 def updateValues(self
, pos
):
92 self
.status
.set_text("Exited")
95 self
.status
.set_text("%s:%s" % (file, lineno
))
101 def viewBtnClicked(self
, btn
):
103 status
= self
.status
.get_label().strip()
104 rx
= re
.compile("\S+:\d+")
107 if rx
.search(status
):
109 [file,lineno
] = string
.split(status
,":")
112 os
.system('gvim -R -c ":%d" %s' % (lineno
,file))