Help on class Text in module tkinter:
class Text(Widget, XView, YView)
| Text(master=None, cnf={}, **kw)
|
| Text widget which can display text in various forms.
|
| Method resolution order:
| Text
| Widget
| BaseWidget
| Misc
| Pack
| Place
| Grid
| XView
| YView
| builtins.object
|
| Methods defined here:
|
| __init__(self, master=None, cnf={}, **kw)
| Construct a text widget with the parent MASTER.
|
| STANDARD OPTIONS
|
| background, borderwidth, cursor,
| exportselection, font, foreground,
| highlightbackground, highlightcolor,
| highlightthickness, insertbackground,
| insertborderwidth, insertofftime,
| insertontime, insertwidth, padx, pady,
| relief, selectbackground,
| selectborderwidth, selectforeground,
| setgrid, takefocus,
| xscrollcommand, yscrollcommand,
|
| WIDGET-SPECIFIC OPTIONS
|
| autoseparators, height, maxundo,
| spacing1, spacing2, spacing3,
| state, tabs, undo, width, wrap,
|
| bbox(self, index)
| Return a tuple of (x,y,width,height) which gives the bounding
| box of the visible part of the character at the given index.
|
| compare(self, index1, op, index2)
| Return whether between index INDEX1 and index INDEX2 the
| relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=.
|
| count(self, index1, index2, *args)
| Counts the number of relevant things between the two indices.
| If index1 is after index2, the result will be a negative number
| (and this holds for each of the possible options).
|
| The actual items which are counted depends on the options given by
| args. The result is a list of integers, one for the result of each
| counting option given. Valid counting options are "chars",
| "displaychars", "displayindices", "displaylines", "indices",
| "lines", "xpixels" and "ypixels". There is an additional possible
| option "update", which if given then all subsequent options ensure
| that any possible out of date information is recalculated.
|
| debug(self, boolean=None)
| Turn on the internal consistency checks of the B-Tree inside the text
| widget according to BOOLEAN.
|
| delete(self, index1, index2=None)
| Delete the characters between INDEX1 and INDEX2 (not included).
|
| dlineinfo(self, index)
| Return tuple (x,y,width,height,baseline) giving the bounding box
| and baseline position of the visible part of the line containing
| the character at INDEX.
|
| dump(self, index1, index2=None, command=None, **kw)
| Return the contents of the widget between index1 and index2.
|
| The type of contents returned in filtered based on the keyword
| parameters; if 'all', 'image', 'mark', 'tag', 'text', or 'window' are
| given and true, then the corresponding items are returned. The result
| is a list of triples of the form (key, value, index). If none of the
| keywords are true then 'all' is used by default.
|
| If the 'command' argument is given, it is called once for each element
| of the list of triples, with the values of each triple serving as the
| arguments to the function. In this case the list is not returned.
|
| edit(self, *args)
| Internal method
|
| This method controls the undo mechanism and
| the modified flag. The exact behavior of the
| command depends on the option argument that
| follows the edit argument. The following forms
| of the command are currently supported:
|
| edit_modified, edit_redo, edit_reset, edit_separator
| and edit_undo
|
| edit_modified(self, arg=None)
| Get or Set the modified flag
|
| If arg is not specified, returns the modified
| flag of the widget. The insert, delete, edit undo and
| edit redo commands or the user can set or clear the
| modified flag. If boolean is specified, sets the
| modified flag of the widget to arg.
|
| edit_redo(self)
| Redo the last undone edit
|
| When the undo option is true, reapplies the last
| undone edits provided no other edits were done since
| then. Generates an error when the redo stack is empty.
| Does nothing when the undo option is false.
|
| edit_reset(self)
| Clears the undo and redo stacks
|
| edit_separator(self)
| Inserts a separator (boundary) on the undo stack.
|
| Does nothing when the undo option is false
|
| edit_undo(self)
| Undoes the last edit action
|
| If the undo option is true. An edit action is defined
| as all the insert and delete commands that are recorded
| on the undo stack in between two separators. Generates
| an error when the undo stack is empty. Does nothing
| when the undo option is false
|
| get(self, index1, index2=None)
| Return the text from INDEX1 to INDEX2 (not included).
|
| image_cget(self, index, option)
| Return the value of OPTION of an embedded image at INDEX.
|
| image_configure(self, index, cnf=None, **kw)
| Configure an embedded image at INDEX.
|
| image_create(self, index, cnf={}, **kw)
| Create an embedded image at INDEX.
|
| image_names(self)
| Return all names of embedded images in this widget.
|
| index(self, index)
| Return the index in the form line.char for INDEX.
|
| insert(self, index, chars, *args)
| Insert CHARS before the characters at INDEX. An additional
| tag can be given in ARGS. Additional CHARS and tags can follow in ARGS.
|
| mark_gravity(self, markName, direction=None)
| Change the gravity of a mark MARKNAME to DIRECTION (LEFT or RIGHT).
| Return the current value if None is given for DIRECTION.
|
| mark_names(self)
| Return all mark names.
|
| mark_next(self, index)
| Return the name of the next mark after INDEX.
|
| mark_previous(self, index)
| Return the name of the previous mark before INDEX.
|
| mark_set(self, markName, index)
| Set mark MARKNAME before the character at INDEX.
|
| mark_unset(self, *markNames)
| Delete all marks in MARKNAMES.
|
| peer_create(self, newPathName, cnf={}, **kw)
| Creates a peer text widget with the given newPathName, and any
| optional standard configuration options. By default the peer will
| have the same start and end line as the parent widget, but
| these can be overridden with the standard configuration options.
|
| peer_names(self)
| Returns a list of peers of this widget (this does not include
| the widget itself).
|
| replace(self, index1, index2, chars, *args)
| Replaces the range of characters between index1 and index2 with
| the given characters and tags specified by args.
|
| See the method insert for some more information about args, and the
| method delete for information about the indices.
|
| scan_dragto(self, x, y)
| Adjust the view of the text to 10 times the
| difference between X and Y and the coordinates given in
| scan_mark.
|
| scan_mark(self, x, y)
| Remember the current X, Y coordinates.
|
| search(self, pattern, index, stopindex=None, forwards=None, backwards=None, exact=None, regexp=None, nocase=None, count=None, elide=None)
| Search PATTERN beginning from INDEX until STOPINDEX.
| Return the index of the first character of a
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
tkinter控件全集(共38种控件的英文帮助) 导入方式:import tkinter as tk,有18种控件(也称组件): Button、Canvas、Checkbutton、Entry、Frame、Label、LabelFrame、Listbox、Menu、Menubutton、Message、OptionMenu、PanedWindow、Radiobutton、Scale、Scrollbar、Spinbox、Text 导入方式:from tkinter import ttk,有20种控件(也称组件): Button、Checkbutton、Combobox、Entry、Frame、Label、LabelFrame、LabeledScale、Labelframe、Menubutton、Notebook、OptionMenu、PanedWindow、Progressbar、Radiobutton、Scale、Scrollbar、Separator、Sizegrip、Spinbox、Treeview
资源推荐
资源详情
资源评论
收起资源包目录
tkinter控件英文帮助全集.zip (38个子文件)
tkinter018.Text.txt 40KB
tkinter007.LabelFrame.txt 29KB
tkinter004.Entry.txt 31KB
tkinter010.Menubutton.txt 29KB
tkinter.ttk005_ttk.Frame.txt 30KB
tkinter.ttk006_ttk.Label.txt 30KB
tkinter.ttk012_ttk.PanedWindow.txt 37KB
tkinter.ttk007_ttk.LabelFrame.txt 30KB
tkinter014.Radiobutton.txt 29KB
tkinter.ttk010_ttk.Notebook.txt 33KB
tkinter.ttk009_ttk.Menubutton.txt 30KB
tkinter.ttk008_ttk.LabeledScale.txt 31KB
tkinter.ttk019_ttk.Spinbox.txt 33KB
tkinter012.OptionMenu.txt 29KB
tkinter.ttk015_ttk.Scale.txt 31KB
tkinter.ttk016_ttk.Scrollbar.txt 31KB
tkinter.ttk020_ttk.Treeview.txt 39KB
tkinter017.Spinbox.txt 34KB
tkinter015.Scale.txt 30KB
tkinter.ttk017_ttk.Separator.txt 30KB
tkinter013.PanedWindow.txt 35KB
tkinter.ttk014_ttk.Radiobutton.txt 30KB
tkinter.ttk001_ttk.Button.txt 30KB
tkinter002.Canvas.txt 37KB
tkinter.ttk002_ttk.Checkbutton.txt 31KB
tkinter003.Checkbutton.txt 30KB
tkinter011.Message.txt 29KB
tkinter.ttk018_ttk.Sizegrip.txt 30KB
tkinter006.Label.txt 29KB
tkinter.ttk003_ttk.Combobox.txt 33KB
tkinter001.Button.txt 30KB
tkinter005.Frame.txt 29KB
tkinter.ttk004_ttk.Entry.txt 33KB
tkinter.ttk013_ttk.Progressbar.txt 31KB
tkinter009.Menu.txt 31KB
tkinter.ttk011_ttk.OptionMenu.txt 31KB
tkinter016.Scrollbar.txt 30KB
tkinter008.Listbox.txt 32KB
共 38 条
- 1
资源评论
HannYang
- 粉丝: 4w+
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功