本文整理汇总了Python中Tkinter.WORD属性的典型用法代码示例。如果您正苦于以下问题:Python Tkinter.WORD属性的具体用法?Python Tkinter.WORD怎么用?Python Tkinter.WORD使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类Tkinter
的用法示例。
在下文中一共展示了Tkinter.WORD属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: 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()
示例2: 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()
示例3: __init__
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import WORD [as 别名]
def __init__(self, status, show, parent=0):
conf = IGMConfig(config_file='config/igm_alt_config.v3.ini', user_config_file=['config/user_igm_alt_config.v3.ini', 'config/user_igm_alt_config.v2.ini'])
ToggledFrame.__init__(self, parent, label="EDR:", status=status, show=show)
self.pack(fill="x", expand=1, pady=2, padx=2, anchor="n")
self.output = tk.Text(self.sub_frame, width=conf.len("general", "body"), height=conf.body_rows("general"),
background=conf.rgb("general", "fill"), foreground=conf.rgb("general", "body"),
wrap=tk.WORD, padx=4, borderwidth=0)
self.output.pack(fill="x", expand=1)
self.__configure_tags(conf)
self.toggle()
示例4: strap_design_frame_builder
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import WORD [as 别名]
def strap_design_frame_builder(self):
self.strap_inputs_frame = tk.Frame(self.strap_design_frame)
self.strap_inputs_frame.pack(side=tk.LEFT, anchor='nw')
self.strap_calc_frame = tk.Frame(self.strap_design_frame)
self.strap_calc_frame.pack(side=tk.RIGHT ,anchor='ne', fill=tk.BOTH, expand=1)
tk.Label(self.strap_inputs_frame, text="B = ", font=self.helv).grid(row=0, column=0, sticky = tk.E)
tk.Entry(self.strap_inputs_frame, textvariable=self.bs, width=10, validate="key", validatecommand=self.reset_status).grid(row=0, column=1)
tk.Label(self.strap_inputs_frame, text="in", font=self.helv).grid(row=0, column=2)
tk.Label(self.strap_inputs_frame, text="H = ", font=self.helv).grid(row=1, column=0, sticky = tk.E)
tk.Entry(self.strap_inputs_frame, textvariable=self.hs, width=10, validate="key", validatecommand=self.reset_status).grid(row=1, column=1)
tk.Label(self.strap_inputs_frame, text="in", font=self.helv).grid(row=1, column=2)
self.strap_vbar_size = tk.StringVar()
self.inputs.append(self.strap_vbar_size)
self.strap_vbar_size.set('3')
self.strap_vbar_size_label = tk.Label(self.strap_inputs_frame, text="Shear\nBar Size (#) : ", font=self.helv)
self.strap_vbar_size_label.grid(row=2,column=0, pady=2)
self.strap_vbar_size_menu = tk.OptionMenu(self.strap_inputs_frame, self.strap_vbar_size, '3', '4', '5', command=self.reset_status)
self.strap_vbar_size_menu.config(font=self.helv)
self.strap_vbar_size_menu.grid(row=2, column=1, padx= 2, sticky=tk.W)
self.strap_bar_size = tk.StringVar()
self.inputs.append(self.strap_bar_size)
self.strap_bar_size.set('3')
self.strap_bar_size_label = tk.Label(self.strap_inputs_frame, text="Flexure\nBar Size (#) : ", font=self.helv)
self.strap_bar_size_label.grid(row=4,column=0, pady=2)
self.strap_bar_size_menu = tk.OptionMenu(self.strap_inputs_frame, self.strap_bar_size, '3', '4', '5','6','7','8','9','10','11','14','18', command=self.reset_status)
self.strap_bar_size_menu.config(font=self.helv)
self.strap_bar_size_menu.grid(row=4, column=1, padx= 2, sticky=tk.W)
self.strap_calc_txtbox = tk.Text(self.strap_calc_frame, height = 25, width = 70, bg= "grey90", font= self.helv_norm, wrap=tk.WORD)
self.strap_calc_txtbox.grid(row=0, column=0, sticky='nsew')
self.strap_scroll = tk.Scrollbar(self.strap_calc_frame, command=self.strap_calc_txtbox.yview)
self.strap_scroll.grid(row=0, column=1, sticky='nsew')
self.strap_calc_txtbox['yscrollcommand'] = self.strap_scroll.set
示例5: __init__
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import WORD [as 别名]
def __init__(self, master):
tk.Frame.__init__(self, master)
self.pack()
tk.Label(self, text="This is a text box").pack()
text_frame = tk.Frame(self, borderwidth=1, relief='sunken')
text_frame.pack(padx=10, pady=10)
self.text = tk.Text(text_frame, width=30, height=4, wrap=tk.WORD)
self.text.pack()
tk.Button(self, text='OK', command=self.ok).pack()
开发者ID:brysontyrrell,项目名称:MacAdmins-2016-Craft-GUIs-with-Python-and-Tkinter,代码行数:15,代码来源:Tkinter_Widget_Examples.py
示例6: __init__
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import WORD [as 别名]
def __init__(self, master):
tk.Frame.__init__(self, master)
self.master.title("File Upload Assistant")
self.master.resizable(False, False)
self.master.tk_setPalette(background='#e6e6e6')
self.master.protocol('WM_DELETE_WINDOW', self.click_cancel)
self.master.bind('<Escape>', self.click_cancel)
self.grid(row=0, column=0)
x = (self.master.winfo_screenwidth() - self.master.winfo_reqwidth()) / 2
y = (self.master.winfo_screenheight() - self.master.winfo_reqheight()) / 3
self.master.geometry("+{}+{}".format(x, y))
self.master.config(menu=tk.Menu(self.master))
self.selected_files = tuple()
self.file_count = tk.StringVar(value='')
file_frame = tk.Frame(self)
file_frame.pack(padx=15, pady=(15, 0), anchor='w')
self.file_button = tk.Button(file_frame, text='Select file(s)...', command=self.file_picker, anchor='w')
self.file_button.pack(side='left')
self.file_label = tk.Label(file_frame, textvariable=self.file_count, anchor='e')
self.file_label.pack(side='right')
tk.Label(self, text="Add a comment:").pack(padx=15, pady=(15, 0), anchor='w')
text_frame = tk.Frame(self, borderwidth=1, relief='sunken')
text_frame.pack(padx=15, pady=15)
self.text = tk.Text(text_frame, width=30, height=4, highlightbackground='#ffffff', highlightcolor="#7baedc",
bg='#ffffff', wrap=tk.WORD, font=("System", 14))
self.text.focus_set()
self.text.pack()
button_frame = tk.Frame(self)
button_frame.pack(padx=15, pady=(0, 15), anchor='e')
self.submit_button = tk.Button(button_frame, text='Submit', default='active', command=self.click_submit)
self.submit_button.pack(side='right')
self.cancel_button = tk.Button(button_frame, text='Cancel', command=self.click_cancel)
self.cancel_button.pack(side='right')
开发者ID:brysontyrrell,项目名称:MacAdmins-2016-Craft-GUIs-with-Python-and-Tkinter,代码行数:49,代码来源:06_File_Uploader.py