@see: L{get_tree} @rtype: L{Window} @return: If this is a child window, return the top-level window it belongs to. If this window is already a top-level window, returns itself. @raise WindowsError: An error occured while processing this re
(self)
| 455 | return subtree |
| 456 | |
| 457 | def get_root(self): |
| 458 | """ |
| 459 | @see: L{get_tree} |
| 460 | @rtype: L{Window} |
| 461 | @return: If this is a child window, return the top-level window it |
| 462 | belongs to. |
| 463 | If this window is already a top-level window, returns itself. |
| 464 | @raise WindowsError: An error occured while processing this request. |
| 465 | """ |
| 466 | hWnd = self.get_handle() |
| 467 | history = set() |
| 468 | hPrevWnd = hWnd |
| 469 | while hWnd and hWnd not in history: |
| 470 | history.add(hWnd) |
| 471 | hPrevWnd = hWnd |
| 472 | hWnd = win32.GetParent(hWnd) |
| 473 | if hWnd in history: |
| 474 | # See: https://docs.google.com/View?id=dfqd62nk_228h28szgz |
| 475 | return self |
| 476 | if hPrevWnd != self.get_handle(): |
| 477 | return self.__get_window(hPrevWnd) |
| 478 | return self |
| 479 | |
| 480 | def get_child_at(self, x, y, bAllowTransparency=True): |
| 481 | """ |
nothing calls this directly
no test coverage detected