本文整理汇总了Python中TkUtil.geometry_for_str方法的典型用法代码示例。如果您正苦于以下问题:Python TkUtil.geometry_for_str方法的具体用法?Python TkUtil.geometry_for_str怎么用?Python TkUtil.geometry_for_str使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TkUtil
的用法示例。
在下文中一共展示了TkUtil.geometry_for_str方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: close
# 需要导入模块: import TkUtil [as 别名]
# 或者: from TkUtil import geometry_for_str [as 别名]
def close(self, event=None):
settings = TkUtil.Settings.Data
settings.put(GENERAL, RESTORE, self.restore)
if self.restore:
geometry = TkUtil.geometry_for_str(self.master.geometry())
position = TkUtil.str_for_geometry(x=geometry.x, y= geometry.y)
settings.put(GENERAL, POSITION, position)
TkUtil.Settings.save()
if self.worker is not None and self.worker.is_alive():
self.state.value = TERMINATING
self.update_ui()
self.worker.join() # Wait for worker to finish
self.quit()
示例2: released
# 需要导入模块: import TkUtil [as 别名]
# 或者: from TkUtil import geometry_for_str [as 别名]
def released(self, event):
if self.dock is None:
return
self.set_drag_cursor(False)
if self.winfo_containing(event.x_root, event.y_root) is None:
# Dropped outside the window
self.dock.undock(event.x_root, event.y_root)
else: # Dropped inside the window
geometry = TkUtil.geometry_for_str(self.master.winfo_geometry())
middle = geometry.x + (geometry.width // 2)
if event.x_root < middle:
self.dock.dock_left()
else:
self.dock.dock_right()
self.x = self.y = self.dock = None
示例3: close
# 需要导入模块: import TkUtil [as 别名]
# 或者: from TkUtil import geometry_for_str [as 别名]
def close(self, event=None):
settings = TkUtil.Settings.Data
settings.put(BOARD, COLUMNS, self.board.columns)
settings.put(BOARD, ROWS, self.board.rows)
settings.put(BOARD, MAXCOLORS, self.board.maxColors)
settings.put(BOARD, DELAY, self.board.delay)
settings.put(BOARD, HIGHSCORE, self.board.highScore)
settings.put(GENERAL, SHAPENAME, self.shapeName.get())
settings.put(GENERAL, ZOOM, int(self.zoom.get()))
settings.put(GENERAL, SHOWTOOLBAR, bool(self.showToolbar.get()))
settings.put(GENERAL, RESTORE, self.restore)
if self.restore:
geometry = TkUtil.geometry_for_str(self.master.geometry())
position = TkUtil.str_for_geometry(x=geometry.x, y= geometry.y)
settings.put(GENERAL, POSITION, position)
TkUtil.Settings.save()
self.quit()