本文整理汇总了Python中TkUtil.x11方法的典型用法代码示例。如果您正苦于以下问题:Python TkUtil.x11方法的具体用法?Python TkUtil.x11怎么用?Python TkUtil.x11使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TkUtil
的用法示例。
在下文中一共展示了TkUtil.x11方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_widgets
# 需要导入模块: import TkUtil [as 别名]
# 或者: from TkUtil import x11 [as 别名]
def create_widgets(self):
self.findLabel = TkUtil.Label(self, text="Find:", underline=1)
self.findEntry = ttk.Entry(self, width=25)
self.replaceLabel = TkUtil.Label(self, text="Replace:",
underline=1)
self.replaceEntry = ttk.Entry(self, width=25)
self.caseSensitiveCheckbutton = TkUtil.Checkbutton(self,
text="Case Sensitive", underline=5,
variable=self.caseSensitive)
self.wholeWordsCheckbutton = TkUtil.Checkbutton(self,
text="Whole Words", underline=0,
variable=self.wholeWords)
self.findButton = TkUtil.Button(self, text="Find", underline=0,
command=self.find, default=tk.ACTIVE, state=tk.DISABLED)
self.replaceButton = TkUtil.Button(self, text="Replace",
underline=0, command=self.replace, state=tk.DISABLED)
self.closeButton = TkUtil.Button(self, text="Close", underline=0,
command=self.close)
if TkUtil.x11():
self.extendButton = TkUtil.ToggleButton(self, text="Extend",
underline=1, command=self.toggle_extend)
else:
self.extendButton = ttk.Button(self, text="Extend",
underline=1, command=self.toggle_extend,
image=self.images[UNEXTEND], compound=tk.LEFT)
self.extensionWidgets = (self.replaceLabel, self.replaceEntry,
self.replaceButton)
示例2: unextend
# 需要导入模块: import TkUtil [as 别名]
# 或者: from TkUtil import x11 [as 别名]
def unextend(self):
self.extendButton.state((TkUtil.NOT_SELECTED,))
self.extendButton.config(text="Extend",
underline=1 if not TkUtil.mac() else -1)
if not TkUtil.x11():
self.extendButton.config(image=self.images[EXTEND])
self.title("Find \u2014 {}".format(APPNAME))
for widget in self.extensionWidgets:
widget.grid_remove()
示例3: extend
# 需要导入模块: import TkUtil [as 别名]
# 或者: from TkUtil import x11 [as 别名]
def extend(self):
self.extendButton.state((TkUtil.SELECTED,))
self.extendButton.config(text="Unextend",
underline=3 if not TkUtil.mac() else -1)
if not TkUtil.x11():
self.extendButton.config(image=self.images[UNEXTEND])
self.title("Find and Replace \u2014 {}".format(APPNAME))
for widget in self.extensionWidgets:
widget.grid()
示例4: create_variables
# 需要导入模块: import TkUtil [as 别名]
# 或者: from TkUtil import x11 [as 别名]
def create_variables(self):
self.caseSensitive = tk.IntVar()
self.caseSensitive.set(0)
self.wholeWords = tk.IntVar()
self.wholeWords.set(0)
self.extensionWidgets = ()
if not TkUtil.x11():
self.images = {}
imagePath = os.path.join(os.path.dirname(
os.path.realpath(__file__)), "images")
for name in (EXTEND, UNEXTEND):
filename = os.path.join(imagePath, name + "_16x16.gif")
if os.path.exists(filename):
self.images[name] = tk.PhotoImage(file=filename)