SlideServe
Menu
Préférences
© SlideServe · v2026

Tkinter Text Widget

darrin avatar
6 diapositives · 268 Views · Sep 02, 2014

Tkinter Text Widget. Dick Steflik CS360. Text Widget. Formatted text display display formatted (fonts, embedded images, embellishments like italics, bolding and underscore) use for multi line text input can be used as a text editor. Indices.

Tkinter Text Widget - slide 1
01 / 6Tkinter Text Widget
1 / 17

Télécharger la présentation

Tkinter Text Widget
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Tkinter Text Widget Dick Steflik CS360

  2. Text Widget • Formatted text display • display formatted (fonts, embedded images, embellishments like italics, bolding and underscore) • use for multi line text input • can be used as a text editor

  3. Indices • Indices are used to point to positions in the text managed by the widget • line/column • “1.0” – points to row 1 column 0 (the first character of the area) • “2.10” – row 2 character 10 • .end • “2.end” – points to the newline char at the end of line 2 • INSERT – the insertion point • CURRENT – character closest to the mouse pointer • END - points to the character just after the last character in the buffer • user defined marks • user defined tags • SEL_FIRST, SEL_LAST – selected character string • window coordinates (“@x,y”) • embedded object names (images, widgets) • expressions (+n chars, -n chars, +n lines, linestart, lineend, wordstart, wordend)

  4. Marks • Invisible objects embedded in the widget’s text. Positioned between character cells and moves along with the text. • INSERT a mark that represents the insertion cursor • CURRENT – a mark that represents the character closest to the cursor. • user defined marks – anywhere, must use mark_set and mark_unset methods

  5. Tags • associate a display styles or event callbacks with ranges of text • tag_config background bgstipple borderwidth fgstipple font foregroung justify lmargin1 lmargin2 offset overstrike relief rmargin spacing1 spacing2 spacing3 tabs underline underline wrap

  6. Methods mark_unset(name) scan_dragto(x,y) scan_mark(x,y) search(lots of parameters) see(index) tag_add(tagName, index) tag_bind(tagName,sequence, func, add=None) tag_cget(tagName, option) tag_config(tagName, cnf={} KW tag_delete(tagNames) tag_lower(tagName, belowThis=None) tag_names(index=None) tag_nextRange(tagName,index1, index2=None) tag_prevrange(tagName, index1,index2=None) tag_raise(tagName, aboveThis=None) tag_ranges(tagName) tag_remove(tagName, index1, index2=None) tag_unbind(tagName, sequence, funcid=None) window_cget(index, option) window_config(index, options) window_create(index,options) window_names() xview(what) xview_moveto(fraction) xview_scroll(number, what) bbox(index) compare(index1,op,index2) config(options) debug(boolean=None) delete(index1,index2) dlineinfo(index) dump(index1,index2,command) edit_modified(arg=None) edit_redo() edit_reset() edit_seperator() edit_undo() get(start,end=None) image_cget(index,option) image_configure(index, options) image_create(index,cnf={},kw) image_names() index(index) insert(index,text,tags) mark_gravity(self,name,direction) mark_names() mark_next() mark_previous() mark_set(name,index) yview(what) yview_moveto(fraction) yview_pickplace(what) yview_scroll(number, what)