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


Python Window.remove方法代码示例

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


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

示例1: update_NET_DESKTOP_GEOMETRY

# 需要导入模块: from window import Window [as 别名]
# 或者: from window.Window import remove [as 别名]
def update_NET_DESKTOP_GEOMETRY(force=False):
    global properties, xinerama

    old_geom = properties["_NET_DESKTOP_GEOMETRY"]
    old_xinerama = xinerama

    time.sleep(1)

    properties["_NET_DESKTOP_GEOMETRY"] = ptxcb.XROOT.get_desktop_geometry()
    xinerama = ptxcb.connection.xinerama_get_screens()

    if old_xinerama != xinerama or force:
        if not force and len(old_xinerama) == len(xinerama):
            for mon in Workspace.iter_all_monitors():
                mid = mon.id
                mon.refresh_bounds(
                    xinerama[mid]["x"], xinerama[mid]["y"], xinerama[mid]["width"], xinerama[mid]["height"]
                )
                mon.calculate_workarea()
        else:
            for mon in Workspace.iter_all_monitors():
                for tiler in mon.tilers:
                    tiler.destroy()

            for wid in Window.WINDOWS.keys():
                Window.remove(wid)

            for wsid in Workspace.WORKSPACES.keys():
                Monitor.remove(wsid)
                Workspace.remove(wsid)

            reset_properties()
            load_properties()
开发者ID:Excedrin,项目名称:pytyle2,代码行数:35,代码来源:state.py

示例2: update_NET_CLIENT_LIST

# 需要导入模块: from window import Window [as 别名]
# 或者: from window.Window import remove [as 别名]
def update_NET_CLIENT_LIST():
    global properties

    old = properties["_NET_CLIENT_LIST"]
    new = set(ptxcb.XROOT.get_window_ids())

    properties["_NET_CLIENT_LIST"] = new

    if old != new:
        for wid in new.difference(old):
            Window.add(wid)

        for wid in old.difference(new):
            Window.remove(wid)

        # This might be redundant, but it's important to know
        # the new active window if the old one was destroyed
        # as soon as possible
        update_NET_ACTIVE_WINDOW()
开发者ID:Excedrin,项目名称:pytyle2,代码行数:21,代码来源:state.py


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