X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=pygdb.py;h=d3cf2690d478bec972ca7fd70cd696d1bf320fe4;hb=fd54ea4a2710afa2bd51e2b8600c4577bdfccc0d;hp=64c48df01fc383ffef040277475070f40b1c3949;hpb=d5dc6369fca636f78c76f0f95aefb9817289e27f;p=pygdb.git diff --git a/pygdb.py b/pygdb.py index 64c48df..d3cf269 100755 --- a/pygdb.py +++ b/pygdb.py @@ -4,6 +4,7 @@ __author__ = "shuber" import gtk +import os import string import sys @@ -12,18 +13,34 @@ import MainControlWindow import StatusWindow -def launchDebugger(clientCmd): +def launchDebugger(clientCmd, quitonclose=True): + + + + def hideWindows(): + #Kill the debugger + dbgterm.stopDbg() + + mainCtrlWnd.destroy() + statusWnd.destroy() + gtk.main_quit() + + + #Determine the closing callback func + if quitonclose: + destroycb = gtk.main_quit + else: + destroycb = hideWindows + #Create Terminal - dbgterm = GdbTerminal.GdbTerminal(clientCmd) + dbgterm = GdbTerminal.GdbTerminal(clientCmd, destroycb) #Create windows - mainCtrlWnd = MainControlWindow.MainControlWindow(dbgterm) - statusWnd = StatusWindow.StatusWindow(mainCtrlWnd, dbgterm) - - #Register callback function for new positions - mainCtrlWnd.newPosCbs += [statusWnd.updateValues] + mainCtrlWnd = MainControlWindow.MainControlWindow(dbgterm, destroycb) + statusWnd = StatusWindow.StatusWindow(mainCtrlWnd, dbgterm, destroycb) + dbgterm.initialize() - gtk.main() + return dbgterm, mainCtrlWnd, statusWnd @@ -37,5 +54,6 @@ if __name__ == "__main__": #Create the terminals clientCmd = string.join(sys.argv[1:]) launchDebugger(clientCmd) + gtk.main()