本文整理汇总了Python中javax.swing.SwingUtilities.getWindowAncestor方法的典型用法代码示例。如果您正苦于以下问题:Python SwingUtilities.getWindowAncestor方法的具体用法?Python SwingUtilities.getWindowAncestor怎么用?Python SwingUtilities.getWindowAncestor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.SwingUtilities
的用法示例。
在下文中一共展示了SwingUtilities.getWindowAncestor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: selectWindow
# 需要导入模块: from javax.swing import SwingUtilities [as 别名]
# 或者: from javax.swing.SwingUtilities import getWindowAncestor [as 别名]
def selectWindow(widget):
w = checkWidget(widget)
window = SwingUtilities.getWindowAncestor(w)
if isinstance(window, JFrame):
runKeyword("selectWindow", window.getTitle())
elif isinstance(window, JDialog):
runKeyword("selectDialog", window.getTitle())
示例2: mouseDragged
# 需要导入模块: from javax.swing import SwingUtilities [as 别名]
# 或者: from javax.swing.SwingUtilities import getWindowAncestor [as 别名]
def mouseDragged(ms, m):
window = SwingUtilities.getWindowAncestor(self)
x = window.getLocation().x
y = window.getLocation().y
xm = (x + m.getX()) - (x + self.initialClick.x)
ym = (y + m.getY()) - (y + self.initialClick.y)
window.setLocation(x + xm, y + ym)
示例3: getDialogTitle
# 需要导入模块: from javax.swing import SwingUtilities [as 别名]
# 或者: from javax.swing.SwingUtilities import getWindowAncestor [as 别名]
def getDialogTitle(self):
window = SwingUtilities.getWindowAncestor(self.widget)
return window.getTitle() if window and hasattr(window, "getTitle") and window.getOwner() else ""