OSDN Git Service

Regist WinWrap reference to windowlist, not widget reference.
authorAiwota Programmer <aiwotaprog@tetteke.tk>
Mon, 21 Aug 2006 09:22:56 +0000 (18:22 +0900)
committerAiwota Programmer <aiwotaprog@tetteke.tk>
Mon, 21 Aug 2006 09:22:56 +0000 (18:22 +0900)
src/Hage1/board_window.py
src/Hage1/brdlist_window.py
src/Hage1/thread_window.py
src/Hage1/windowlist.py

index 9adf90c..367b4d1 100644 (file)
@@ -41,15 +41,14 @@ def open_board(bbs, board):
         raise ValueError, "parameter must not be empty"
 
     key = "/" + bbs + "/" + board
-    window = windowlist.get_window(key)
-    if window:
+    winwrap = windowlist.get_window(key)
+    if winwrap:
         # already opened
-        window.present()
+        winwrap.window.present()
         pass
     else:
         win_wrap = WinWrap(bbs, board)
-        widget = win_wrap.widget_tree.get_widget("board_window")
-        windowlist.window_created(key, widget)
+        windowlist.window_created(key, win_wrap)
 
 
 class WinWrap:
index 6b81642..e657e63 100644 (file)
@@ -35,13 +35,12 @@ def open_brdlist(bbs):
         raise ValueError, "parameter must not be empty"
 
     key = "/" + bbs
-    window = windowlist.get_window(key)
-    if window:
-        window.present()
+    winwrap = windowlist.get_window(key)
+    if winwrap:
+        winwrap.present()
     else:
         win_wrap = WinWrap(bbs)
-        widget = win_wrap.widget_tree.get_widget("brdlist_window")
-        windowlist.window_created(key, widget)
+        windowlist.window_created(key, win_wrap)
 
 
 class WinWrap:
index 25b8865..c28d5e4 100644 (file)
@@ -42,14 +42,14 @@ def open_thread(bbs, board, thread):
         raise ValueError, "parameter must not be empty"
 
     key = "/" + bbs + "/" + board + "/" + thread
-    window = windowlist.get_window(key)
-    if window:
+    winwrap = windowlist.get_window(key)
+    if winwrap:
         # already opened
-        window.present()
+        winwrap.window.present()
         pass
     else:
         win_wrap = WinWrap(bbs, board, thread)
-        windowlist.window_created(key, win_wrap.window)
+        windowlist.window_created(key, win_wrap)
 
 
 class WinWrap:
index 6888919..60e62e4 100644 (file)
@@ -28,14 +28,14 @@ def get_window(key):
     else:
         return None
 
-def window_created(key, widget):
-    if not key or not widget:
+def window_created(key, winwrap):
+    if not key or not winwrap:
         raise ValueError, "parameter must not be empty"
 
     if key in _windows:
         return False
-    widget.connect("destroy", on_window_destroy, key)
-    _windows[key] = widget
+    winwrap.window.connect("destroy", on_window_destroy, key)
+    _windows[key] = winwrap
     print "regist to _windows", key
     return True