]>
git.sthu.org Git - pygdb.git/blob - StatusWindow.py
15 import BreakpointsFrame
21 class StatusWindow (gtk
.Window
):
23 def __init__(self
, debugger
, vimservername
):
24 gtk
.Window
.__init
__(self
)
26 self
.vimservername
= vimservername
27 self
.debugger
= debugger
28 self
.debugger
.gotActiveCallback
+= [self
.updateValues
]
30 self
.set_border_width(5)
31 self
.set_title("Status")
32 self
.set_default_size(400,600)
33 self
.connect("destroy", DbgTerminal
.quitHandler
)
36 #Vbox container of frames
37 vbox
= gtk
.VBox(False, 5)
43 self
.frames
+= [PositionFrame
.PositionFrame(debugger
), \
44 WatchesFrame
.WatchesFrame(debugger
), \
45 BreakpointsFrame
.BreakpointsFrame(debugger
) ]
47 #Register callback after frames!
48 self
.debugger
.gotActiveCallback
+= [self
.updateValues
]
51 self
.paned1
= gtk
.VPaned()
54 self
.paned2
= gtk
.VPaned()
55 self
.paned1
.add2(self
.paned2
)
57 self
.paned1
.add1(self
.frames
[1])
58 self
.paned2
.add1(self
.frames
[2])
59 self
.paned2
.add2(self
.frames
[0])
64 def applyConfiguration(self
, conf
):
66 w
= conf
.findInt("statuswnd-width")
67 h
= conf
.findInt("statuswnd-height")
68 paned1
= conf
.findInt("statuswnd-paned1")
69 paned2
= conf
.findInt("statuswnd-paned2")
71 if w
!=None and h
!=None:
74 self
.paned1
.set_position(paned1
)
76 self
.paned2
.set_position(paned2
)
79 while not self
.debugger
.isActive():
83 f
.applyConfiguration(conf
)
86 def fillConfiguration(self
, conf
):
88 conf
.addInt("statuswnd-width", self
.get_size()[0])
89 conf
.addInt("statuswnd-height", self
.get_size()[1])
90 conf
.addInt("statuswnd-paned1", self
.paned1
.get_position())
91 conf
.addInt("statuswnd-paned2", self
.paned2
.get_position())
93 conf
.setCommand( self
.debugger
.clientCmd
)
96 f
.fillConfiguration(conf
)
99 def updateValues(self
, status
, param
):
101 conf
= Configuration
.Configuration()
102 self
.fillConfiguration(conf
)
103 conf
.store(".pygdb.conf")
110 os
.system('gvim --servername %s --remote-send "<ESC> :GDBLoadConfig<CR>"' % \