]>
git.sthu.org Git - pygdb.git/blob - StatusWindow.py
15 import BreakpointsFrame
21 class StatusWindow (gtk
.Window
):
23 def __init__(self
, debugger
):
24 gtk
.Window
.__init
__(self
)
26 self
.debugger
= debugger
27 self
.debugger
.gotActiveCallback
+= [self
.updateValues
]
29 self
.set_border_width(5)
30 self
.set_title("Status")
31 self
.set_default_size(400,600)
32 self
.connect("destroy", DbgTerminal
.quitHandler
)
35 #Vbox container of frames
36 vbox
= gtk
.VBox(False, 5)
42 self
.frames
+= [PositionFrame
.PositionFrame(debugger
), \
43 WatchesFrame
.WatchesFrame(debugger
), \
44 BreakpointsFrame
.BreakpointsFrame(debugger
) ]
46 #Register callback after frames!
47 self
.debugger
.gotActiveCallback
+= [self
.updateValues
]
50 self
.paned1
= gtk
.VPaned()
53 self
.paned2
= gtk
.VPaned()
54 self
.paned1
.add2(self
.paned2
)
56 self
.paned1
.add1(self
.frames
[1])
57 self
.paned2
.add1(self
.frames
[2])
58 self
.paned2
.add2(self
.frames
[0])
63 def applyConfiguration(self
, conf
):
65 w
= conf
.findInt("statuswnd-width")
66 h
= conf
.findInt("statuswnd-height")
67 paned1
= conf
.findInt("statuswnd-paned1")
68 paned2
= conf
.findInt("statuswnd-paned2")
70 if w
!=None and h
!=None:
73 self
.paned1
.set_position(paned1
)
75 self
.paned2
.set_position(paned2
)
78 while not self
.debugger
.isActive():
82 f
.applyConfiguration(conf
)
85 def fillConfiguration(self
, conf
):
87 conf
.addInt("statuswnd-width", self
.get_size()[0])
88 conf
.addInt("statuswnd-height", self
.get_size()[1])
89 conf
.addInt("statuswnd-paned1", self
.paned1
.get_position())
90 conf
.addInt("statuswnd-paned2", self
.paned2
.get_position())
93 f
.fillConfiguration(conf
)
96 def updateValues(self
, status
, param
):
98 conf
= Configuration
.Configuration()
99 self
.fillConfiguration(conf
)
100 conf
.store(".pygdb.conf")
102 DbgTerminal
.updateVim()