本文整理汇总了Python中window.Window方法的典型用法代码示例。如果您正苦于以下问题:Python window.Window方法的具体用法?Python window.Window怎么用?Python window.Window使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类window
的用法示例。
在下文中一共展示了window.Window方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_windows
# 需要导入模块: import window [as 别名]
# 或者: from window import Window [as 别名]
def get_windows(self):
"""
@rtype: list of L{Window}
@return: Returns a list of windows handled by this thread.
"""
try:
process = self.get_process()
except Exception:
process = None
return [
Window( hWnd, process, self ) \
for hWnd in win32.EnumThreadWindows( self.get_tid() )
]
#------------------------------------------------------------------------------
# TODO
# A registers cache could be implemented here.
示例2: get_window_at
# 需要导入模块: import window [as 别名]
# 或者: from window import Window [as 别名]
def get_window_at(x, y):
"""
Get the window located at the given coordinates in the desktop.
If no such window exists an exception is raised.
@see: L{find_window}
@type x: int
@param x: Horizontal coordinate.
@type y: int
@param y: Vertical coordinate.
@rtype: L{Window}
@return: Window at the requested position. If no such window
exists a C{WindowsError} exception is raised.
@raise WindowsError: An error occured while processing this request.
"""
return Window( win32.WindowFromPoint( (x, y) ) )
示例3: make_window
# 需要导入模块: import window [as 别名]
# 或者: from window import Window [as 别名]
def make_window(self, **kwargs):
"""Make a Window"""
import window
return(window.Window(**kwargs))
示例4: __init__
# 需要导入模块: import window [as 别名]
# 或者: from window import Window [as 别名]
def __init__(self, width, height, title):
super(GlutWindow, self).__init__()
self.width = width
self.height = height
self.title = title
self.texture_id = 0
self.vertices = None
self.pixels = np.zeros(self.width * self.height, np.uint32)
self.window = Window(self.pixels, self.width, self.height)
self.setup()
示例5: find_window
# 需要导入模块: import window [as 别名]
# 或者: from window import Window [as 别名]
def find_window(className = None, windowName = None):
"""
Find the first top-level window in the current desktop to match the
given class name and/or window name. If neither are provided any
top-level window will match.
@see: L{get_window_at}
@type className: str
@param className: (Optional) Class name of the window to find.
If C{None} or not used any class name will match the search.
@type windowName: str
@param windowName: (Optional) Caption text of the window to find.
If C{None} or not used any caption text will match the search.
@rtype: L{Window} or None
@return: A window that matches the request. There may be more matching
windows, but this method only returns one. If no matching window
is found, the return value is C{None}.
@raise WindowsError: An error occured while processing this request.
"""
# I'd love to reverse the order of the parameters
# but that might create some confusion. :(
hWnd = win32.FindWindow(className, windowName)
if hWnd:
return Window(hWnd)
示例6: get_foreground_window
# 需要导入模块: import window [as 别名]
# 或者: from window import Window [as 别名]
def get_foreground_window():
"""
@rtype: L{Window}
@return: Returns the foreground window.
@raise WindowsError: An error occured while processing this request.
"""
return Window( win32.GetForegroundWindow() )
示例7: get_shell_window
# 需要导入模块: import window [as 别名]
# 或者: from window import Window [as 别名]
def get_shell_window():
"""
@rtype: L{Window}
@return: Returns the shell window.
@raise WindowsError: An error occured while processing this request.
"""
return Window( win32.GetShellWindow() )
示例8: get_top_level_windows
# 需要导入模块: import window [as 别名]
# 或者: from window import Window [as 别名]
def get_top_level_windows():
"""
@rtype: L{Window}
@return: Returns the top-level windows in the current desktop.
@raise WindowsError: An error occured while processing this request.
"""
return [ Window( hWnd ) for hWnd in win32.EnumWindows() ]
#------------------------------------------------------------------------------
示例9: get_windows
# 需要导入模块: import window [as 别名]
# 或者: from window import Window [as 别名]
def get_windows(self):
"""
@rtype: list of L{Window}
@return: Returns a list of windows
handled by all processes in this snapshot.
"""
window_list = list()
for process in self.iter_processes():
window_list.extend( process.get_windows() )
return window_list
示例10: force_garbage_collection
# 需要导入模块: import window [as 别名]
# 或者: from window import Window [as 别名]
def force_garbage_collection(bIgnoreExceptions = True):
"""
Close all Win32 handles the Python garbage collector failed to close.
@type bIgnoreExceptions: bool
@param bIgnoreExceptions: C{True} to ignore any exceptions that may be
raised when detaching.
"""
try:
import gc
gc.collect()
bRecollect = False
for obj in list(gc.garbage):
try:
if isinstance(obj, win32.Handle):
obj.close()
elif isinstance(obj, Event):
obj.debug = None
elif isinstance(obj, Process):
obj.clear()
elif isinstance(obj, Thread):
obj.set_process(None)
obj.clear()
elif isinstance(obj, Module):
obj.set_process(None)
elif isinstance(obj, Window):
obj.set_process(None)
else:
continue
gc.garbage.remove(obj)
del obj
bRecollect = True
except Exception, e:
if not bIgnoreExceptions:
raise
warnings.warn(str(e), RuntimeWarning)
if bRecollect:
gc.collect()
示例11: __init__
# 需要导入模块: import window [as 别名]
# 或者: from window import Window [as 别名]
def __init__(self):
from codec import Codec
from window import Window
from system import System
from datajar import DataJar
from filesystem import FileSystem
try:
manifest = json.load(codecs.open('manifest.json', 'r', 'utf-8'))
except:
manifest = {}
for key in assets.manifest:
if key in manifest:
assets.manifest[key] = manifest[key]
self.app = QApplication(sys.argv)
self.app.setApplicationName(assets.manifest['name'])
self.app.setApplicationVersion(assets.manifest['version'])
assets.sys = System()
assets.codec = Codec()
assets.fs = FileSystem()
assets.dataJar = DataJar()
translator = QTranslator()
if translator.load("zh_CN.qm"):
self.app.installTranslator(translator)
self.window = Window(None, assets.manifest['path'] + 'index.html')
sys.exit(self.app.exec_())
示例12: createWindow
# 需要导入模块: import window [as 别名]
# 或者: from window import Window [as 别名]
def createWindow(self, type, url = None):
from window import Window
window = Window(self.view().parentWidget(), url, isDialog = (type == QWebPage.WebModalDialog))
return window.webView.page()
示例13: createWindow
# 需要导入模块: import window [as 别名]
# 或者: from window import Window [as 别名]
def createWindow(self, url = '', width = None, height = None):
from window import Window
return Window(self.window, self.normUrl(url), width, height)
# 对话框
示例14: createDialog
# 需要导入模块: import window [as 别名]
# 或者: from window import Window [as 别名]
def createDialog(self, url = '', width = None, height = None):
from window import Window
return Window(self.window, self.normUrl(url), width, height, True)
# 文件选择对话框