Graphical user interfaces for Python programs Phần 9 ppsx

1 151 0
Graphical user interfaces for Python programs Phần 9 ppsx

Đang tải... (xem toàn văn)

Thông tin tài liệu

528 APPENDIX B TKINTER REFERENCE ciated widget. For example, if first is 0.2 and last is 0.4, it means that the first part of the document visible in the window is 20% of the way through the document, and the last visible part is 40% of the way through. Text Description The Text class defines a new window and creates an instance of a text widget. Additional options, described below, may be specified in the method call or in the option database to configure aspects of the text such as its default background color and relief. The text method returns the path name of the new window. A text widget displays one or more lines of text and allows that text to be edited. Text widgets support four different kinds of annotations on the text: tags, marks, embedded win- dows and embedded images. Tags allow different portions of the text to be displayed with dif- ferent fonts and colors. In addition, Tcl commands can be associated with tags so that scripts are invoked when particular actions such as keystrokes and mouse button presses occur in par- ticular ranges of the text. The second form of annotation consists of marks, which are floating markers in the text. Marks are used to keep track of various interesting positions in the text as it is edited. The third form of annotation allows arbitrary windows to be embedded in a text widget. The fourth form of annotation allows Tk images to be embedded in a text widget. Many of the widget commands for texts take one or more indices as arguments. An index is a string used to indicate a particular place within a text, such as a place to insert characters or one endpoint of a range of characters to delete. Inheritance Text inherits from Widget.) Shared options Option (alias) Default background (bg) SystemWindow borderwidth (bd) 2 cursor xterm font (('MS', 'Sans', 'Serif'), '8') foreground (fg) SystemWindowText height 24 highlightbackground SystemButtonFace highlightcolor SystemWindowFrame highlightthickness 0 . second form of annotation consists of marks, which are floating markers in the text. Marks are used to keep track of various interesting positions in the text as it is edited. The third form. windows to be embedded in a text widget. The fourth form of annotation allows Tk images to be embedded in a text widget. Many of the widget commands for texts take one or more indices as arguments 528 APPENDIX B TKINTER REFERENCE ciated widget. For example, if first is 0.2 and last is 0.4, it means that the first part of the document visible

Ngày đăng: 05/08/2014, 14:20

Tài liệu cùng người dùng

Tài liệu liên quan