当前位置: 首页>>代码示例>>Python>>正文


Python Window.valid_windows_from_monitor方法代码示例

本文整理汇总了Python中pwt.window.Window.valid_windows_from_monitor方法的典型用法代码示例。如果您正苦于以下问题:Python Window.valid_windows_from_monitor方法的具体用法?Python Window.valid_windows_from_monitor怎么用?Python Window.valid_windows_from_monitor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pwt.window.Window的用法示例。


在下文中一共展示了Window.valid_windows_from_monitor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: start

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import valid_windows_from_monitor [as 别名]
    def start(self):
        'start the listeners with a safety try/finally to unregister keys and kill the icon'
        self.notifyicon.show_balloon('Go!', 'PWT')

        # Do an initial lookup of all the windows and tile accordingly
        for monitor in self.monitors:
            windows = Window.valid_windows_from_monitor(monitor)
            for window in windows:
                self.add_window(monitor.tilers[self.group], window)
            monitor.tilers[self.group].tile_windows()

        try:
            # message priming read
            message = self.notifyicon.windowmessage

            while message:
                if message[1][1] == WM_HOTKEY:
                    # if message is WM_HOTKEY
                    # execute the corresponding hotkeycmd using the id
                    self.notifyicon.hotkeys[message[1][2]-1].execute()
                elif message[1][2] in self.ADD_EVENTS:
                    # if lparam is an add event
                    window = Window(message[1][3])
                    self.add_window(self.current_tiler, window)
                elif message[1][2] in self.REMOVE_EVENTS:
                    #if lparam is a remove event
                    self.handle_remove_event(message[1][3], Monitor.monitor_from_point_in_list(
                        self.monitors, message[1][5]))
                if self.stop:
                    self.notifyicon.show_balloon('Stopping!', 'PWT')
                    break

                # Grab the next message from the message queue
                message = self.notifyicon.windowmessage
        except:
            logging.exception('Exception occurred')

        self.notifyicon.unregister_shellhook()  # Unregister shellhook
        self.notifyicon.unregister_hotkeys()    # Unregister hotkeys
        self.decorate_all_tiled_windows()   # Decorate windows
        self.taskbar.show()                 # make sure the taskbar is shown on exit
        self.notifyicon.destroy()           # Remove icon
开发者ID:mm318,项目名称:python-windows-tiler,代码行数:44,代码来源:controller.py

示例2: start

# 需要导入模块: from pwt.window import Window [as 别名]
# 或者: from pwt.window.Window import valid_windows_from_monitor [as 别名]
    def start(self):
        "start the listeners with a safety try/finally to unregister keys and kill the icon"

        self.notifyicon.show_balloon("Go!", "PWT")

        #Do an initial lookup of all the windows and tile accordingly
        for monitor in self.monitors:

            monitor.tilers[self.group].windows = Window.valid_windows_from_monitor(monitor)
            monitor.tilers[self.group].tile_windows()

        try:

            #message priming read
            message = self.notifyicon.windowmessage

            while message:

                #if message is WM_HOTKEY
                if message[1][1] == WM_HOTKEY:

                    #execute the corresponding hotkeycmd using the id
                    self.notifyicon.hotkeys[message[1][2] - 1].execute()

                #if lparam is an add event
                elif message[1][2] in self.ADD_EVENTS:
                    
                    window = Window(message[1][3])

                    if window not in self.current_group_windows:
                        
                        self.current_tiler.add_window(window)
                    
                #if lparam is a remove event
                elif message[1][2] in self.REMOVE_EVENTS:

                    self.handle_remove_event(Window(message[1][3])
                            , Monitor.monitor_from_point_in_list(self.monitors, message[1][5]))

                if self.stop:

                    self.notifyicon.show_balloon("Stop!", "PWT")
                    break

                #Grab the next message from the message queue
                message = self.notifyicon.windowmessage

        finally:

            #Unregister hotkeys and shellhook
            self.notifyicon.unregister_shellhook()
            self.notifyicon.unregister_hotkeys()

            #Decorate windows
            self.decorate_all_tiledwindows()

            #make sure the taskbar is shown on exit
            self.taskbar.show()

            #Remove icon
            self.notifyicon.destroy()
开发者ID:Tzbob,项目名称:python-windows-tiler,代码行数:63,代码来源:controller.py


注:本文中的pwt.window.Window.valid_windows_from_monitor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。