Server: appserver-7f0f8755-nginx-15961cad18524ec5a9db05f2a6a7e440
Current directory: /usr/lib/python2.7/lib-tk
Software: nginx/1.27.5
Shell Command
Create a new file
Upload file
File: ScrolledText.py
"""A ScrolledText widget feels like a text widget but also has a vertical scroll bar on its right. (Later, options may be added to add a horizontal bar as well, to make the bars disappear automatically when not needed, to move them to the other side of the window, etc.) Configuration options are passed to the Text widget. A Frame widget is inserted between the master and the text, to hold the Scrollbar widget. Most methods calls are inherited from the Text widget; Pack, Grid and Place methods are redirected to the Frame widget however. """ __all__ = ['ScrolledText'] from Tkinter import Frame, Text, Scrollbar, Pack, Grid, Place from Tkconstants import RIGHT, LEFT, Y, BOTH class ScrolledText(Text): def __init__(self, master=None, **kw): self.frame = Frame(master) self.vbar = Scrollbar(self.frame) self.vbar.pack(side=RIGHT, fill=Y) kw.update({'yscrollcommand': self.vbar.set}) Text.__init__(self, self.frame, **kw) self.pack(side=LEFT, fill=BOTH, expand=True) self.vbar['command'] = self.yview # Copy geometry methods of self.frame without overriding Text # methods -- hack! text_meths = vars(Text).keys() methods = vars(Pack).keys() + vars(Grid).keys() + vars(Place).keys() methods = set(methods).difference(text_meths) for m in methods: if m[0] != '_' and m != 'config' and m != 'configure': setattr(self, m, getattr(self.frame, m)) def __str__(self): return str(self.frame) def example(): import __main__ from Tkconstants import END stext = ScrolledText(bg='white', height=10) stext.insert(END, __main__.__doc__) stext.pack(fill=BOTH, side=LEFT, expand=True) stext.focus_set() stext.mainloop() if __name__ == "__main__": example()
.
36 Items
Change directory
Remove directory
Rename directory
..
442 Items
Change directory
Remove directory
Rename directory
Canvas.py
7.29 KB
Edit
Delete
Copy
Move
Remame
Canvas.pyc
15.04 KB
Edit
Delete
Copy
Move
Remame
Dialog.py
1.53 KB
Edit
Delete
Copy
Move
Remame
Dialog.pyc
1.87 KB
Edit
Delete
Copy
Move
Remame
FileDialog.py
8.62 KB
Edit
Delete
Copy
Move
Remame
FileDialog.pyc
9.45 KB
Edit
Delete
Copy
Move
Remame
FixTk.py
2.95 KB
Edit
Delete
Copy
Move
Remame
FixTk.pyc
2.04 KB
Edit
Delete
Copy
Move
Remame
ScrolledText.py
1.79 KB
Edit
Delete
Copy
Move
Remame
ScrolledText.pyc
2.59 KB
Edit
Delete
Copy
Move
Remame
SimpleDialog.py
3.64 KB
Edit
Delete
Copy
Move
Remame
SimpleDialog.pyc
4.22 KB
Edit
Delete
Copy
Move
Remame
Tix.py
75.49 KB
Edit
Delete
Copy
Move
Remame
Tix.pyc
93.19 KB
Edit
Delete
Copy
Move
Remame
Tkconstants.py
1.46 KB
Edit
Delete
Copy
Move
Remame
Tkconstants.pyc
2.19 KB
Edit
Delete
Copy
Move
Remame
Tkdnd.py
11.22 KB
Edit
Delete
Copy
Move
Remame
Tkdnd.pyc
12.47 KB
Edit
Delete
Copy
Move
Remame
Tkinter.py
156.77 KB
Edit
Delete
Copy
Move
Remame
Tkinter.pyc
194.33 KB
Edit
Delete
Copy
Move
Remame
tkColorChooser.py
1.74 KB
Edit
Delete
Copy
Move
Remame
tkColorChooser.pyc
1.38 KB
Edit
Delete
Copy
Move
Remame
tkCommonDialog.py
1.38 KB
Edit
Delete
Copy
Move
Remame
tkCommonDialog.pyc
1.47 KB
Edit
Delete
Copy
Move
Remame
tkFileDialog.py
5.59 KB
Edit
Delete
Copy
Move
Remame
tkFileDialog.pyc
5.01 KB
Edit
Delete
Copy
Move
Remame
tkFont.py
5.95 KB
Edit
Delete
Copy
Move
Remame
tkFont.pyc
6.92 KB
Edit
Delete
Copy
Move
Remame
tkMessageBox.py
3.6 KB
Edit
Delete
Copy
Move
Remame
tkMessageBox.pyc
3.78 KB
Edit
Delete
Copy
Move
Remame
tkSimpleDialog.py
7.54 KB
Edit
Delete
Copy
Move
Remame
tkSimpleDialog.pyc
8.85 KB
Edit
Delete
Copy
Move
Remame
ttk.py
54.69 KB
Edit
Delete
Copy
Move
Remame
ttk.pyc
60.79 KB
Edit
Delete
Copy
Move
Remame
turtle.py
135.78 KB
Edit
Delete
Copy
Move
Remame
turtle.pyc
135.84 KB
Edit
Delete
Copy
Move
Remame