當前位置: 首頁>>代碼示例>>Python>>正文


Python font.NORMAL屬性代碼示例

本文整理匯總了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) 
開發者ID:lovexiaov,項目名稱:python-in-practice,代碼行數:18,代碼來源:Main.py

示例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) 
開發者ID:lovexiaov,項目名稱:python-in-practice,代碼行數:19,代碼來源:Main.py

示例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 
開發者ID:TkinterEP,項目名稱:ttkwidgets,代碼行數:18,代碼來源:chooser.py

示例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 
開發者ID:TkinterEP,項目名稱:ttkwidgets,代碼行數:18,代碼來源:selectframe.py

示例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) 
開發者ID:lovexiaov,項目名稱:python-in-practice,代碼行數:9,代碼來源:Main.py

示例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])) 
開發者ID:lovexiaov,項目名稱:python-in-practice,代碼行數:9,代碼來源:Main.py

示例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) 
開發者ID:lovexiaov,項目名稱:python-in-practice,代碼行數:7,代碼來源:Main.py

示例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) 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:12,代碼來源:configDialog.py

示例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) 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:12,代碼來源:configDialog.py

示例10: KeyBindingSelected

# 需要導入模塊: from tkinter import font [as 別名]
# 或者: from tkinter.font import NORMAL [as 別名]
def KeyBindingSelected(self, event):
        self.buttonNewKeys.config(state=NORMAL) 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:4,代碼來源:configDialog.py

示例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) 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:8,代碼來源:configDialog.py

示例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() 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:12,代碼來源:configDialog.py


注:本文中的tkinter.font.NORMAL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。