X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=pygdb.py;h=d3cf2690d478bec972ca7fd70cd696d1bf320fe4;hb=fd54ea4a2710afa2bd51e2b8600c4577bdfccc0d;hp=66fe63452f8f355adab3298b07b26b4c0455ea83;hpb=1094f7f4581a9c0074294004bbd8c934593a54d5;p=pygdb.git diff --git a/pygdb.py b/pygdb.py index 66fe634..d3cf269 100755 --- a/pygdb.py +++ b/pygdb.py @@ -4,6 +4,7 @@ __author__ = "shuber" import gtk +import os import string import sys @@ -12,16 +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) + mainCtrlWnd = MainControlWindow.MainControlWindow(dbgterm, destroycb) + statusWnd = StatusWindow.StatusWindow(mainCtrlWnd, dbgterm, destroycb) dbgterm.initialize() - gtk.main() + return dbgterm, mainCtrlWnd, statusWnd @@ -35,5 +54,6 @@ if __name__ == "__main__": #Create the terminals clientCmd = string.join(sys.argv[1:]) launchDebugger(clientCmd) + gtk.main()