OSDN Git Service

To set focus to threadview's drawingarea is not called in Class ThreadView, but in...
authorAiwota Programmer <aiwotaprog@tetteke.tk>
Sun, 19 Apr 2009 02:59:12 +0000 (11:59 +0900)
committerAiwota Programmer <aiwotaprog@tetteke.tk>
Sun, 19 Apr 2009 02:59:12 +0000 (11:59 +0900)
src/FukuiNoNamari/thread_view.py
src/FukuiNoNamari/thread_window.py

index 580feec..214e279 100644 (file)
@@ -488,12 +488,6 @@ class ThreadView(gtk.HBox):
         self.drawingarea = gtk.DrawingArea()
         self.drawingarea.set_property("can_focus", True)
 
-        def set_focus():
-            top = self.drawingarea.get_toplevel()
-            if top.get_property("type") == gtk.WINDOW_TOPLEVEL:
-                top.set_focus(self.drawingarea)
-        gobject.idle_add(set_focus)
-
         self.vscrollbar = gtk.VScrollbar()
         self.pack_start(self.drawingarea)
         self.pack_start(self.vscrollbar, expand=False)
index b97da8f..472df57 100644 (file)
@@ -151,6 +151,7 @@ class WinWrap(winwrapbase.WinWrapBase):
         self.threadpopup.push_thread_view(self.threadview)
         self.vbox.pack_start(self.threadview)
         self.vbox.reorder_child(self.threadview, 2)
+        self.window.set_focus(self.threadview.drawingarea)
 
         self.threadview.on_uri_clicked = self.on_threadview_uri_clicked