本文整理汇总了Python中monitor.Monitor.remove方法的典型用法代码示例。如果您正苦于以下问题:Python Monitor.remove方法的具体用法?Python Monitor.remove怎么用?Python Monitor.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类monitor.Monitor
的用法示例。
在下文中一共展示了Monitor.remove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_NET_DESKTOP_GEOMETRY
# 需要导入模块: from monitor import Monitor [as 别名]
# 或者: from monitor.Monitor 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()
示例2: update_NET_NUMBER_OF_DESKTOPS
# 需要导入模块: from monitor import Monitor [as 别名]
# 或者: from monitor.Monitor import remove [as 别名]
def update_NET_NUMBER_OF_DESKTOPS():
global properties, xinerama
old = properties["_NET_NUMBER_OF_DESKTOPS"]
properties["_NET_NUMBER_OF_DESKTOPS"] = ptxcb.XROOT.get_number_of_desktops()
# Add destops...
if old < properties["_NET_NUMBER_OF_DESKTOPS"]:
for wsid in xrange(old, properties["_NET_NUMBER_OF_DESKTOPS"]):
Workspace.add(wsid)
Monitor.add(wsid, xinerama)
# Remove desktops
elif old > properties["_NET_NUMBER_OF_DESKTOPS"]:
for wsid in xrange(properties["_NET_NUMBER_OF_DESKTOPS"], old):
Monitor.remove(wsid)
Workspace.remove(wsid)