本文整理汇总了Python中tkinter.font.NORMAL属性的典型用法代码示例。如果您正苦于以下问题:Python font.NORMAL属性的具体用法?Python font.NORMAL怎么用?Python font.NORMAL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类tkinter.font
的用法示例。
在下文中一共展示了font.NORMAL属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_modified
# 需要导入模块: from tkinter import font [as 别名]
# 或者: from tkinter.font import NORMAL [as 别名]
def on_modified(self, event=None):
if not hasattr(self, "modifiedLabel"):
self.editor.edit_modified(False)
return
if self.editor.edit_modified():
text, mac, state = "MOD", True, tk.NORMAL
else:
text, mac, state = "", False, tk.DISABLED
self.modifiedLabel.config(text=text)
if TkUtil.mac():
self.master.attributes("-modified", mac)
self.fileMenu.entryconfigure(SAVE, state=state)
self.fileMenu.entryconfigure(SAVE_AS + ELLIPSIS, state=state)
self.saveButton.config(state=state)
self.editMenu.entryconfigure(UNDO, state=state)
self.undoButton.config(state=state)
示例2: update_recent_files_menu
# 需要导入模块: from tkinter import font [as 别名]
# 或者: from tkinter.font import NORMAL [as 别名]
def update_recent_files_menu(self):
if self.recentFiles:
menu = tk.Menu(self.fileMenu)
i = 1
for filename in self.recentFiles:
if filename != self.editor.filename:
menu.add_command(label="{}. {}".format(i, filename),
underline=0, command=lambda filename=filename:
self.load(filename))
i += 1
self.fileMenu.entryconfigure(OPEN_RECENT,
menu=menu)
self.fileMenu.entryconfigure(OPEN_RECENT,
state=tk.NORMAL if i > 1 else tk.DISABLED)
else:
self.fileMenu.entryconfigure(OPEN_RECENT,
state=tk.DISABLED)
示例3: font
# 需要导入模块: from tkinter import font [as 别名]
# 或者: from tkinter.font import NORMAL [as 别名]
def font(self):
"""
Selected font.
:return: font tuple (family_name, size, \*options), :class:`~font.Font` object
"""
if self._family is None:
return None, None
else:
font_tuple = self.__generate_font_tuple()
font_obj = tkfont.Font(family=self._family, size=self._size,
weight=tkfont.BOLD if self._bold else tkfont.NORMAL,
slant=tkfont.ITALIC if self._italic else tkfont.ROMAN,
underline=1 if self._underline else 0,
overstrike=1 if self._overstrike else 0)
return font_tuple, font_obj
示例4: font
# 需要导入模块: from tkinter import font [as 别名]
# 或者: from tkinter.font import NORMAL [as 别名]
def font(self):
"""
Font property.
:return: a :class:`~font.Font` object if family is set, else None
:rtype: :class:`~font.Font` or None
"""
if not self._family:
return None, None
font_obj = font.Font(family=self._family, size=self._size,
weight=font.BOLD if self._bold else font.NORMAL,
slant=font.ITALIC if self._italic else font.ROMAN,
underline=1 if self._underline else 0,
overstrike=1 if self._overstrike else 0)
font_tuple = self.__generate_font_tuple()
return font_tuple, font_obj
示例5: on_selection
# 需要导入模块: from tkinter import font [as 别名]
# 或者: from tkinter.font import NORMAL [as 别名]
def on_selection(self, event=None):
state = (tk.NORMAL if self.editor.text.tag_ranges(tk.SEL)
else tk.DISABLED)
self.editMenu.entryconfigure(COPY, state=state)
self.copyButton.config(state=state)
self.editMenu.entryconfigure(CUT, state=state)
self.cutButton.config(state=state)
示例6: on_moved
# 需要导入模块: from tkinter import font [as 别名]
# 或者: from tkinter.font import NORMAL [as 别名]
def on_moved(self, event=None):
state = tk.NORMAL if not self.editor.is_empty() else tk.DISABLED
self.editMenu.entryconfigure(FIND + ELLIPSIS, state=state)
self.findButton.config(state=state)
lineCol = self.editor.index(tk.INSERT).split(".")
self.positionLabel.config(text="↓{}→{}".format(lineCol[0],
lineCol[1]))
示例7: create_font
# 需要导入模块: from tkinter import font [as 别名]
# 或者: from tkinter.font import NORMAL [as 别名]
def create_font(self):
weight = tkfont.BOLD if int(self.bold.get()) else tkfont.NORMAL
slant = tkfont.ITALIC if int(self.italic.get()) else tkfont.ROMAN
return tkfont.Font(family=self.fontFamily.get(),
size=self.fontPointSize.get(), weight=weight, slant=slant)
示例8: SetThemeType
# 需要导入模块: from tkinter import font [as 别名]
# 或者: from tkinter.font import NORMAL [as 别名]
def SetThemeType(self):
if self.themeIsBuiltin.get():
self.optMenuThemeBuiltin.config(state=NORMAL)
self.optMenuThemeCustom.config(state=DISABLED)
self.buttonDeleteCustomTheme.config(state=DISABLED)
else:
self.optMenuThemeBuiltin.config(state=DISABLED)
self.radioThemeCustom.config(state=NORMAL)
self.optMenuThemeCustom.config(state=NORMAL)
self.buttonDeleteCustomTheme.config(state=NORMAL)
示例9: SetKeysType
# 需要导入模块: from tkinter import font [as 别名]
# 或者: from tkinter.font import NORMAL [as 别名]
def SetKeysType(self):
if self.keysAreBuiltin.get():
self.optMenuKeysBuiltin.config(state=NORMAL)
self.optMenuKeysCustom.config(state=DISABLED)
self.buttonDeleteCustomKeys.config(state=DISABLED)
else:
self.optMenuKeysBuiltin.config(state=DISABLED)
self.radioKeysCustom.config(state=NORMAL)
self.optMenuKeysCustom.config(state=NORMAL)
self.buttonDeleteCustomKeys.config(state=NORMAL)
示例10: KeyBindingSelected
# 需要导入模块: from tkinter import font [as 别名]
# 或者: from tkinter.font import NORMAL [as 别名]
def KeyBindingSelected(self, event):
self.buttonNewKeys.config(state=NORMAL)
示例11: SetFontSample
# 需要导入模块: from tkinter import font [as 别名]
# 或者: from tkinter.font import NORMAL [as 别名]
def SetFontSample(self, event=None):
fontName = self.fontName.get()
fontWeight = tkFont.BOLD if self.fontBold.get() else tkFont.NORMAL
newFont = (fontName, self.fontSize.get(), fontWeight)
self.labelFontSample.config(font=newFont)
self.textHighlightSample.configure(font=newFont)
示例12: SetHighlightTarget
# 需要导入模块: from tkinter import font [as 别名]
# 或者: from tkinter.font import NORMAL [as 别名]
def SetHighlightTarget(self):
if self.highlightTarget.get() == 'Cursor': #bg not possible
self.radioFg.config(state=DISABLED)
self.radioBg.config(state=DISABLED)
self.fgHilite.set(1)
else: #both fg and bg can be set
self.radioFg.config(state=NORMAL)
self.radioBg.config(state=NORMAL)
self.fgHilite.set(1)
self.SetColourSample()