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


Python tkinter.WORD屬性代碼示例

本文整理匯總了Python中tkinter.WORD屬性的典型用法代碼示例。如果您正苦於以下問題:Python tkinter.WORD屬性的具體用法?Python tkinter.WORD怎麽用?Python tkinter.WORD使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在tkinter的用法示例。


在下文中一共展示了tkinter.WORD屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: createWidgets

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import WORD [as 別名]
def createWidgets(self):    
        tabControl = ttk.Notebook(self.win)     
        tab1 = ttk.Frame(tabControl)            
        tabControl.add(tab1, text='Tab 1')    
        tabControl.pack(expand=1, fill="both")  
        self.monty = ttk.LabelFrame(tab1, text=' Monty Python ')
        self.monty.grid(column=0, row=0, padx=8, pady=4)        

        scr = scrolledtext.ScrolledText(self.monty, width=30, height=3, wrap=tk.WORD)
        scr.grid(column=0, row=3, sticky='WE', columnspan=3)

        menuBar = Menu(tab1)
        self.win.config(menu=menuBar)
        fileMenu = Menu(menuBar, tearoff=0)
        menuBar.add_cascade(label="File", menu=fileMenu)
        helpMenu = Menu(menuBar, tearoff=0)
        menuBar.add_cascade(label="Help", menu=helpMenu)
        
        self.createButtons() 
開發者ID:PacktPublishing,項目名稱:Python-GUI-Programming-Cookbook-Third-Edition,代碼行數:21,代碼來源:GUI_DesignPattern.py

示例2: cb_word_wrap

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import WORD [as 別名]
def cb_word_wrap(self, widget=None, data=None):
        self._text_box.configure(wrap=Tk.WORD if self._word_wrap_tkval.get() else Tk.NONE)
        self._gui_config["word_wrap"] = self._word_wrap_tkval.get() 
開發者ID:textext,項目名稱:textext,代碼行數:5,代碼來源:asktext.py

示例3: run

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import WORD [as 別名]
def run(self):
        root = tk.Tk()
        self.root = root
        root.title("Application Log")
        text = tk.Text(root)
        text.pack(side=tk.LEFT, fill=tk.BOTH, expand = tk.YES)
        text.config(wrap=tk.WORD)
        self.text = text
        yscroll = tk.Scrollbar(command=text.yview)
        text['yscrollcommand'] = yscroll.set
        yscroll.pack(side=tk.RIGHT, fill=tk.Y)
        text.config(state=tk.DISABLED)
        self.update()
        root.mainloop()
        self.r_queue.put(("die", None))

# Q: OK. So you put Tkinter in it's own process.
#    Now why is Pystray in another process too?!
# A: Because if I don't, MPV and GNOME Appindicator
#    try to access the same resources and cause the
#    entire application to segfault.
#
# I suppose this means I can put the Tkinter GUI back
# into the main process. This is true, but then the
# two need to be merged, which is non-trivial. 
開發者ID:iwalton3,項目名稱:plex-mpv-shim,代碼行數:27,代碼來源:gui_mgr.py

示例4: user

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import WORD [as 別名]
def user(self):  # 用戶信息
        User = tk.LabelFrame(self.window, text="關鍵字任務", padx=10, pady=5)  # 水平,垂直方向上的邊距均為 10
        User.place(x=30, y=100)
        self.userListBox = Listbox(User, width=50, height=9, )
        self.userListBox.pack(side=LEFT)
        userScroBar = Scrollbar(User)
        userScroBar.pack(side=RIGHT, fill=Y)

        self.userListBox['yscrollcommand'] = userScroBar.set
        self.insert_userListbox()
        userScroBar['command'] = self.userListBox.yview
        # userScrotext = scrolledtext.ScrolledText(User, width=30, height=6, padx=10, pady=10, wrap=tk.WORD)
        # userScrotext.grid(columnspan=2, pady=10)
        Useroption = tk.LabelFrame(self.window, text="", padx=10, pady=5)  # 水平,垂直方向上的邊距均為 10
        Useroption.place(x=30, y=300)
        tk.Button(Useroption, text="添加關鍵字", command=self.add_user).grid(column=0, row=1, padx=57, pady=5)
        tk.Button(Useroption, text="刪除關鍵字", command=self.delete_use).grid(column=1, row=1, padx=57, pady=5)
        tk.Button(Useroption, text="一鍵開啟", command=self.all_start).grid(column=0, row=3, padx=55, pady=5)
        tk.Button(Useroption, text="一鍵關閉", command=self.all_stop).grid(column=1, row=3, padx=55, pady=5)
        self.startBtn = tk.Button(Useroption, text="單項開啟", command=self.start_spider)
        self.startBtn.grid(column=0, row=2, padx=55, pady=5)
        self.stopBtn = tk.Button(Useroption, text="單項關閉", command=self.stop_spider)
        self.stopBtn.grid(column=1, row=2, padx=55, pady=5) 
開發者ID:Hatcat123,項目名稱:XianyuSdd,代碼行數:25,代碼來源:tkXianYu.py

示例5: __init__

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import WORD [as 別名]
def __init__(self, master, **kwargs):
        super().__init__(**kwargs)

        self.master = master

        self.config(wrap=tk.WORD)  # CHAR NONE

        self.tag_configure('find_match', background="yellow")
        self.find_match_index = None
        self.find_search_starting_index = 1.0

        self.bind_events() 
開發者ID:PacktPublishing,項目名稱:Tkinter-GUI-Programming-by-Example,代碼行數:14,代碼來源:textarea.py

示例6: __init__

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import WORD [as 別名]
def __init__(self, master, **kwargs):
        super().__init__(**kwargs)

        self.master = master

        self.config(wrap=tk.WORD)  # CHAR NONE

        self.bind_events() 
開發者ID:PacktPublishing,項目名稱:Tkinter-GUI-Programming-by-Example,代碼行數:10,代碼來源:textarea.py

示例7: create_central_area

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import WORD [as 別名]
def create_central_area(self):
        self.editor = Editor.Editor(self.master,
                set_status_text=self.set_status_text,
                font=self.create_font(), maxundo=0, undo=True,
                wrap=tk.WORD)
        self.editor.grid(row=1, column=1, sticky=(tk.N, tk.S, tk.W, tk.E),
                padx=PAD, pady=PAD)
        self.editor.text.bind("<<Selection>>", self.on_selection)
        self.editor.text.bind("<<Modified>>", self.on_modified)
        self.editor.text.bind("<KeyRelease>", self.on_moved, "+")
        self.editor.text.bind("<ButtonRelease>", self.on_moved, "+")
        self.editor.text.focus() 
開發者ID:lovexiaov,項目名稱:python-in-practice,代碼行數:14,代碼來源:Main.py

示例8: body

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import WORD [as 別名]
def body(self, master):
        self.editor = TkUtil.TextEdit.TextEdit(master, takefocus=False,
                exportselection=False, width=self.width,
                height=self.height, undo=False, wrap=tk.WORD, relief=None,
                borderwidth=0, setgrid=True)
        self.text = self.editor.text
        self.create_tags()
        self.populate_text()
        self.text.config(state=tk.DISABLED)
        self.editor.pack(fill=tk.BOTH, expand=True)
        return self.editor 
開發者ID:lovexiaov,項目名稱:python-in-practice,代碼行數:13,代碼來源:About.py

示例9: word_wrap_toggled_cb

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import WORD [as 別名]
def word_wrap_toggled_cb(self, action, sourceview):
        sourceview.set_wrap_mode(Gtk.WrapMode.WORD if action.get_active() else Gtk.WrapMode.NONE)
        self._gui_config["word_wrap"] = action.get_active() 
開發者ID:textext,項目名稱:textext,代碼行數:5,代碼來源:asktext.py

示例10: createWidgets

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import WORD [as 別名]
def createWidgets():    
    tabControl = ttk.Notebook(win)     
    tab1 = ttk.Frame(tabControl)            
    tabControl.add(tab1, text='Tab 1')    
    tabControl.pack(expand=1, fill="both")  
    monty = ttk.LabelFrame(tab1, text=' Mighty Python ')
    monty.grid(column=0, row=0, padx=8, pady=4)        
    
    ttk.Label(monty, text="Enter a name:").grid(column=0, row=0, sticky='W')
    name = tk.StringVar()
    nameEntered = ttk.Entry(monty, width=12, textvariable=name)
    nameEntered.grid(column=0, row=1, sticky='W')
    
    action = ttk.Button(monty, text="Click Me!")   
    action.grid(column=2, row=1)
    
    ttk.Label(monty, text="Choose a number:").grid(column=1, row=0)
    number = tk.StringVar()
    numberChosen = ttk.Combobox(monty, width=12, textvariable=number)
    numberChosen['values'] = (42)
    numberChosen.grid(column=1, row=1)
    numberChosen.current(0)
    
    scrolW = 30; scrolH = 3
    scr = scrolledtext.ScrolledText(monty, width=scrolW, height=scrolH, wrap=tk.WORD)
    scr.grid(column=0, row=3, sticky='WE', columnspan=3)
    
    menuBar = Menu(tab1)
    win.config(menu=menuBar)
    fileMenu = Menu(menuBar, tearoff=0)
    menuBar.add_cascade(label="File", menu=fileMenu)
    helpMenu = Menu(menuBar, tearoff=0)
    menuBar.add_cascade(label="Help", menu=helpMenu)
    
    nameEntered.focus()     
#====================== 
開發者ID:PacktPublishing,項目名稱:Python-GUI-Programming-Cookbook-Second-Edition,代碼行數:38,代碼來源:GUI_Not_OOP.py

示例11: createWidgets

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import WORD [as 別名]
def createWidgets(self):    
        tabControl = ttk.Notebook(self.win)     
        tab1 = ttk.Frame(tabControl)            
        tabControl.add(tab1, text='Tab 1')    
        tabControl.pack(expand=1, fill="both")  
        self.monty = ttk.LabelFrame(tab1, text=' Mighty Python ')
        self.monty.grid(column=0, row=0, padx=8, pady=4)        
        
        ttk.Label(self.monty, text="Enter a name:").grid(column=0, row=0, sticky='W')
        self.name = tk.StringVar()
        nameEntered = ttk.Entry(self.monty, width=12, textvariable=self.name)
        nameEntered.grid(column=0, row=1, sticky='W')

        self.action = ttk.Button(self.monty, text="Click Me!")   
        self.action.grid(column=2, row=1)
        
        ttk.Label(self.monty, text="Choose a number:").grid(column=1, row=0)
        number = tk.StringVar()
        numberChosen = ttk.Combobox(self.monty, width=12, textvariable=number)
        numberChosen['values'] = (42)
        numberChosen.grid(column=1, row=1)
        numberChosen.current(0)
   
        scrolW = 30; scrolH = 3
        self.scr = scrolledtext.ScrolledText(self.monty, width=scrolW, height=scrolH, wrap=tk.WORD)
        self.scr.grid(column=0, row=3, sticky='WE', columnspan=3)

        menuBar = Menu(tab1)
        self.win.config(menu=menuBar)
        fileMenu = Menu(menuBar, tearoff=0)
        menuBar.add_cascade(label="File", menu=fileMenu)
        helpMenu = Menu(menuBar, tearoff=0)
        menuBar.add_cascade(label="Help", menu=helpMenu)

        nameEntered.focus()     
#========================== 
開發者ID:PacktPublishing,項目名稱:Python-GUI-Programming-Cookbook-Second-Edition,代碼行數:38,代碼來源:GUI_OOP.py

示例12: __init__

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import WORD [as 別名]
def __init__(self, master):
        super().__init__(master)
        # Get the username and save list of found files.
        self.__user = getpass.getuser()
        self.__dirlist = set()
        # Create widgets.
        self.__log = tkinter.Text(self)
        self.__bar = tkinter.ttk.Scrollbar(self, orient=tkinter.VERTICAL,
                                           command=self.__log.yview)
        self.__ent = tkinter.ttk.Entry(self, cursor='xterm')
        # Configure widgets.
        self.__log.configure(state=tkinter.DISABLED, wrap=tkinter.WORD,
                             yscrollcommand=self.__bar.set)
        # Create binding.
        self.__ent.bind('<Return>', self.create_message)
        # Position widgets.
        self.__log.grid(row=0, column=0, sticky=tkinter.NSEW)
        self.__bar.grid(row=0, column=1, sticky=tkinter.NS)
        self.__ent.grid(row=1, column=0, columnspan=2, sticky=tkinter.EW)
        # Configure resizing.
        self.grid_rowconfigure(0, weight=1)
        self.grid_columnconfigure(0, weight=1)
        # Focus entry.
        self.__ent.focus_set()
        # Schedule message discovery.
        self.after_idle(self.get_messages) 
開發者ID:ActiveState,項目名稱:code,代碼行數:28,代碼來源:recipe-577637.py

示例13: _add_tooltip_text

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import WORD [as 別名]
def _add_tooltip_text(self, tooltip_window):
        tooltip = tk.Text(tooltip_window, relief=tk.SOLID, width=40, wrap=tk.WORD)
        height = math.ceil(len(self.text) / 40) + self.text.count('\n')
        tooltip.insert(tk.END, self.text)
        tooltip.config(state=tk.DISABLED, height=height)
        tooltip.pack(ipadx=1)
    #end _add_tooltip_text
#end class Tooltip 
開發者ID:shitwolfymakes,項目名稱:Endless-Sky-Mission-Builder,代碼行數:10,代碼來源:Tooltip.py

示例14: log

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import WORD [as 別名]
def log(self):  # 日誌
        self.logMessage.put('歡迎使用【閑魚信息采集器】')
        logInformation = tk.LabelFrame(self.window, text="日誌", padx=10, pady=10)  # 水平,垂直方向上的邊距均為10
        logInformation.place(x=450, y=100)
        self.logInformation_Window = scrolledtext.ScrolledText(logInformation, width=77, height=22, padx=10, pady=10,
                                                               wrap=tk.WORD)
        self.logInformation_Window.grid() 
開發者ID:Hatcat123,項目名稱:XianyuSdd,代碼行數:9,代碼來源:tkXianYu.py

示例15: error_log

# 需要導入模塊: import tkinter [as 別名]
# 或者: from tkinter import WORD [as 別名]
def error_log(self):  # 係統日誌
        error_logInformation = tk.LabelFrame(self.window, text="係統日誌", padx=10, pady=10)  # 水平,垂直方向上的邊距均為10
        error_logInformation.place(x=450, y=460)
        self.errorInformation_Window = scrolledtext.ScrolledText(error_logInformation, width=77, height=5, padx=10,
                                                                 pady=10,
                                                                 wrap=tk.WORD)
        self.errorInformation_Window.grid()

    # 菜單說明 
開發者ID:Hatcat123,項目名稱:XianyuSdd,代碼行數:11,代碼來源:tkXianYu.py


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