本文整理汇总了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()
示例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.
示例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)
示例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()
示例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()
示例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()
示例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
示例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()
示例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()
#==========================
示例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)
示例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
示例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()
示例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()
# 菜单说明