本文整理汇总了Python中pwt.window.Window.focused_window方法的典型用法代码示例。如果您正苦于以下问题:Python Window.focused_window方法的具体用法?Python Window.focused_window怎么用?Python Window.focused_window使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pwt.window.Window
的用法示例。
在下文中一共展示了Window.focused_window方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cmd_print_focused_window_classname
# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
def cmd_print_focused_window_classname(self):
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText(Window.focused_window().classname)
win32clipboard.CloseClipboard()
print(Window.focused_window().classname)
示例2: shift_focused_window_down
# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
def shift_focused_window_down(self):
"""
Switches the window to the next position
"""
#get focused window
window = Window.focused_window()
#only grab and move the window if it is in the self
if window in self.windows:
i = self.windows.index(window)
#if the foreground window is the last window, shift everything and place it first
if i == len(self.windows) - 1:
self.windows[0], self.windows[1:] = self.windows[i], self.windows[:i]
#else shift it with the following window
else:
self.windows[i], self.windows[i+1] = self.windows[i+1], self.windows[i]
self.tile_windows()
if not window.focus():
self.remove_window(window)
示例3: cmd_toggle_tiled_floating
# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
def cmd_toggle_tiled_floating(self):
win = Window.focused_window(self.windows)
if(win != None):
if(win.floating):
win.tile()
else:
win.float()
示例4: shift_focused_window_up
# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
def shift_focused_window_up(self):
"""
Switches the window to the previous position
"""
window = Window.focused_window()
#only grab and move the window if it is in the self
if window in self.windows:
i = self.windows.index(window)
#if the foreground window is first, shift everything and place it last
if i == 0:
j = len(self.windows) - 1
self.windows[j], self.windows[:j] = self.windows[0], self.windows[1:]
#else shift it with the trailing window
else:
j = i - 1
self.windows[i], self.windows[j] = self.windows[j], self.windows[i]
self.tile_windows()
if not window.focus():
self.remove_window(window)
示例5: next_layout
# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
def next_layout(self):
"""
Switch to the next layout
"""
nextLayout = Utility.next_item(self.layouts, self.currentLayout)
if nextLayout:
self.currentLayout = nextLayout
self.masterarea = self.currentLayout.maxSize // 2
self.tile_windows()
if not Window.focused_window().center_cursor():
self.remove_window(Window.focused_window())
示例6: cmd_send_to_group_9
# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
def cmd_send_to_group_9(self):
if self.group != 8:
window = Window.focused_window()
if window:
self.send_window_to_tiler(window, 8)
示例7: cmd_move_to_next_monitor
# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
def cmd_move_to_next_monitor(self):
window = Window.focused_window(self.windows)
# if(window.validate()):
monitor = Monitor.monitor_from_window_in_list(self.monitors, window)
nextMonitor = Utility.next_item(self.monitors, monitor)
if(monitor != nextMonitor):
tiler = monitor.tilers[self.group]
nextTiler = nextMonitor.tilers[self.group]
tiler.remove_window(window)
nextTiler.add_window(window)
window.focus()
示例8: cmd_move_to_previous_monitor
# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
def cmd_move_to_previous_monitor(self):
window = Window.focused_window(self.windows)
# if(window.validate()):
monitor = Monitor.monitor_from_window_in_list(self.monitors, window)
previousMonitor = Utility.previous_item(self.monitors, monitor)
if(monitor != previousMonitor):
tiler = monitor.tilers[self.group]
previousTiler = previousMonitor.tilers[self.group]
tiler.remove_window(window)
previousTiler.add_window(window)
window.focus()
示例9: focus_next
# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
def focus_next(self):
"""
Sets focus on the next window
"""
window = Utility.next_item(self.windows, Window.focused_window())
if window:
if not window.focus():
self.remove_window(window)
else:
self.focus_primary()
示例10: focus_previous
# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
def focus_previous(self):
"""
Sets focus on the previous window
"""
#get focused window
window = Utility.previous_item(self.windows, Window.focused_window())
if window:
if not window.focus():
self.remove_window(window)
else:
self.focus_primary()
示例11: make_focused_primary
# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
def make_focused_primary(self):
"""
Moves the focused window to the first place in the masterarea
"""
window = Window.focused_window()
#only move the focused window if it is in the tiler
if window in self.windows:
i = self.windows.index(window)
windowrest = self.windows[:i]
windowrest.extend(self.windows[i+1:])
#shift window location
self.windows[0], self.windows[1:] = self.windows[i], windowrest
self.tile_windows()
if not window.focus():
self.remove_window(window)
示例12: cmd_shift_to_previous_monitor
# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
def cmd_shift_to_previous_monitor(self):
window = Window.focused_window()
if window.validate():
monitor = Monitor.monitor_from_window_in_list(self.monitors, window)
previousMonitor = Utility.previous_item(self.monitors, monitor)
if previousMonitor:
tiler = monitor.tilers[self.group]
previousTiler = previousMonitor.tilers[self.group]
if window in tiler.windows:
tiler.remove_window(window)
if window not in previousTiler.windows:
previousTiler.add_window(window)
window.focus()
示例13: cmd_shift_to_next_monitor
# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
def cmd_shift_to_next_monitor(self):
window = Window.focused_window()
if window.validate():
monitor = Monitor.monitor_from_window_in_list(self.monitors, window)
nextMonitor = Utility.next_item(self.monitors, monitor)
if nextMonitor:
tiler = monitor.tilers[self.group]
nextTiler = nextMonitor.tilers[self.group]
if window in tiler.windows:
tiler.remove_window(window)
if window not in nextTiler.windows:
nextTiler.add_window(window)
window.focus()
示例14: cmd_tile_focused_window
# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
def cmd_tile_focused_window(self):
self.current_tiler.tile_window(Window.focused_window())
示例15: cmd_toggle_stacked_column
# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import focused_window [as 别名]
def cmd_toggle_stacked_column(self):
win = Window.focused_window(self.windows)
if(win != None and win.container.toggle_stacking()):
win.container.container.container.tile_windows()