make Toplevel call start_gtk

This commit is contained in:
Tom Tromey
2013-11-15 19:26:37 -07:00
parent 558fef88b2
commit 99ca7a2297
3 changed files with 5 additions and 5 deletions

View File

@@ -41,8 +41,7 @@ class GuiSourceCommand(gdb.Command):
def invoke(self, arg, from_tty):
self.dont_repeat()
gui.startup.start_gtk()
gui.startup.send_to_gtk(gui.source.SourceWindow)
gui.source.SourceWindow()
class GuiLogWindowCommand(gdb.Command):
"""Create a new log window.
@@ -63,7 +62,6 @@ class GuiLogWindowCommand(gdb.Command):
def invoke(self, arg, from_tty):
self.dont_repeat()
gui.startup.start_gtk()
window = gui.logwindow.LogWindow()
print "Created log window %d; now the default" % window.number
@@ -136,8 +134,6 @@ class GuiDisplayCommand(gdb.Command):
def invoke(self, arg, from_tty):
self.dont_repeat()
# FIXME: perhaps Toplevel should be calling startup_gtk
gui.startup.start_gtk()
gui.display.DisplayWindow(arg)
def complete(self, text, word):

View File

@@ -176,7 +176,10 @@ class SourceWindow(Toplevel):
def __init__(self):
super(SourceWindow, self).__init__()
gui.startup.send_to_gtk(self._initialize)
@in_gtk_thread
def _initialize(self):
self.frame = None
self.do_step = Invoker("step")

View File

@@ -21,6 +21,7 @@ import threading
class _ToplevelState(object):
def __init__(self):
gui.startup.start_gtk()
# This lock must be held when using the other globals here.
self.toplevel_lock = threading.Lock()
self.next_toplevel = 1