本文整理汇总了Python中tkFont.NORMAL属性的典型用法代码示例。如果您正苦于以下问题:Python tkFont.NORMAL属性的具体用法?Python tkFont.NORMAL怎么用?Python tkFont.NORMAL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类tkFont
的用法示例。
在下文中一共展示了tkFont.NORMAL属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _leave
# 需要导入模块: import tkFont [as 别名]
# 或者: from tkFont import NORMAL [as 别名]
def _leave(self, event, image):
widget = event.widget
if widget and widget['state'] != tk.DISABLED:
widget.configure(state = tk.NORMAL)
if image:
image.configure(foreground = self.current['foreground'], background = self.current['background'])
# Set up colors
示例2: SetThemeType
# 需要导入模块: import tkFont [as 别名]
# 或者: from tkFont 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)
示例3: SetKeysType
# 需要导入模块: import tkFont [as 别名]
# 或者: from tkFont 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)
示例4: KeyBindingSelected
# 需要导入模块: import tkFont [as 别名]
# 或者: from tkFont import NORMAL [as 别名]
def KeyBindingSelected(self,event):
self.buttonNewKeys.config(state=NORMAL)
示例5: SetFontSample
# 需要导入模块: import tkFont [as 别名]
# 或者: from tkFont import NORMAL [as 别名]
def SetFontSample(self,event=None):
fontName=self.fontName.get()
if self.fontBold.get():
fontWeight=tkFont.BOLD
else:
fontWeight=tkFont.NORMAL
newFont = (fontName, self.fontSize.get(), fontWeight)
self.labelFontSample.config(font=newFont)
self.textHighlightSample.configure(font=newFont)
示例6: SetHighlightTarget
# 需要导入模块: import tkFont [as 别名]
# 或者: from tkFont 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()
示例7: KeyBindingSelected
# 需要导入模块: import tkFont [as 别名]
# 或者: from tkFont import NORMAL [as 别名]
def KeyBindingSelected(self, event):
self.buttonNewKeys.config(state=NORMAL)
示例8: SetFontSample
# 需要导入模块: import tkFont [as 别名]
# 或者: from tkFont 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)
示例9: SetHighlightTarget
# 需要导入模块: import tkFont [as 别名]
# 或者: from tkFont 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()
示例10: _colors
# 需要导入模块: import tkFont [as 别名]
# 或者: from tkFont import NORMAL [as 别名]
def _colors(self, root, theme):
style = ttk.Style()
if platform == 'linux2':
style.theme_use('clam')
# Default dark theme colors
if not config.get('dark_text'):
config.set('dark_text', '#ff8000') # "Tangerine" in OSX color picker
if not config.get('dark_highlight'):
config.set('dark_highlight', 'white')
if theme:
# Dark
(r, g, b) = root.winfo_rgb(config.get('dark_text'))
self.current = {
'background' : 'grey4', # OSX inactive dark titlebar color
'foreground' : config.get('dark_text'),
'activebackground' : config.get('dark_text'),
'activeforeground' : 'grey4',
'disabledforeground' : '#%02x%02x%02x' % (r/384, g/384, b/384),
'highlight' : config.get('dark_highlight'),
# Font only supports Latin 1 / Supplement / Extended, and a few General Punctuation and Mathematical Operators
'font' : (theme > 1 and not 0x250 < ord(_('Cmdr')[0]) < 0x3000 and
tkFont.Font(family='Euro Caps', size=10, weight=tkFont.NORMAL) or
'TkDefaultFont'),
}
else:
# (Mostly) system colors
style = ttk.Style()
self.current = {
'background' : (platform == 'darwin' and 'systemMovableModalBackground' or
style.lookup('TLabel', 'background')),
'foreground' : style.lookup('TLabel', 'foreground'),
'activebackground' : (platform == 'win32' and 'SystemHighlight' or
style.lookup('TLabel', 'background', ['active'])),
'activeforeground' : (platform == 'win32' and 'SystemHighlightText' or
style.lookup('TLabel', 'foreground', ['active'])),
'disabledforeground' : style.lookup('TLabel', 'foreground', ['disabled']),
'highlight' : 'blue',
'font' : 'TkDefaultFont',
}
# Apply current theme to a widget and its children, and register it for future updates