12.07.2015 Views

Tkinter reference: A GUI for Python

Tkinter reference: A GUI for Python

Tkinter reference: A GUI for Python

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

aligncreatepadxpadystretchwindow.window_names()Specifies how to position the embedded widget vertically in itsline, if it isn’t as tall as the text on the line. Values include:CENTER (the default), which centers the widget vertically withinthe line; TOP, which places the top of the image at the top ofthe line; BOTTOM, which places the bottom of the image at thebottom of the line; and BASELINE, which aligns the bottom ofthe image with the text baseline.A procedure that will create the embedded widget on demand.This procedure takes no arguments and must create the widgetas a child of the text widget and return the widget as its result.Extra space added to the left and right of the widget within thetext line. Default is 0.Extra space added above and below the widget within the textline. Default is 0.This option controls what happens when the line is higher thanthe embedded widget. Normally this option is 0, meaning thatthe embedded widget is left at its natural size. If you set stretchto 1, the widget is stretched vertically to fill the height of the line,and the align option is ignored.The widget to be embedded. This widget must be a child of thetext widget.Returns a sequence containing the names of all embedded widgets..xview ( MOVETO, fraction ).xview ( SCROLL, n, what )This method scrolls the text widget horizontally, and is intended <strong>for</strong> binding to thecommand option of a related horizontal scrollbar.This method can be called in two different ways. The first call positions the text at a valuegiven by offset, where 0.0 moves the text to its leftmost position and 1.0 to its rightmostposition. The second call moves the text left or right: the what argument specifies howmuch to move and can be either UNITS or PAGES, and n tells how many characters orpages to move the text to the right relative to its image (or left, if negative)..xview_moveto ( fraction )This method scrolls the text in the same way as .xview(MOVETO, fraction)..xview_scroll ( n, what )Same as .xview(SCROLL, n, what)..yview(MOVETO, fraction).yview(SCROLL, n, what).yview_moveto(fraction).yview_scroll(n, what)These are the same as the .xview() and related methods, only <strong>for</strong> vertical scrolling.When scrolling verticallly by UNITS, the units are lines.New Mexico Tech Computer Center <strong>Tkinter</strong> <strong>reference</strong>: The Text widget Page 59

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!