mirror of https://github.com/python/cpython.git
Add PathBrowser to File module
This commit is contained in:
parent
a917af7fc7
commit
d6e8713f81
|
@ -16,6 +16,7 @@
|
||||||
('_Open...', '<<open-window-from-file>>'),
|
('_Open...', '<<open-window-from-file>>'),
|
||||||
('Open _module...', '<<open-module>>'),
|
('Open _module...', '<<open-module>>'),
|
||||||
('Class _browser', '<<open-class-browser>>'),
|
('Class _browser', '<<open-class-browser>>'),
|
||||||
|
('_Path browser', '<<open-path-browser>>'),
|
||||||
('Python shell', '<<open-python-shell>>'),
|
('Python shell', '<<open-python-shell>>'),
|
||||||
None,
|
None,
|
||||||
('_Save', '<<save-window>>'),
|
('_Save', '<<save-window>>'),
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
#$ win <Alt-c>
|
#$ win <Alt-c>
|
||||||
#$ unix <Control-x><Control-b>
|
#$ unix <Control-x><Control-b>
|
||||||
|
|
||||||
|
#$ event <<open-path-browser>>
|
||||||
|
|
||||||
#$ event <<close-window>>
|
#$ event <<close-window>>
|
||||||
#$ unix <Control-x><Control-0>
|
#$ unix <Control-x><Control-0>
|
||||||
#$ unix <Control-x><Key-0>
|
#$ unix <Control-x><Key-0>
|
||||||
|
@ -118,6 +120,7 @@ def __init__(self, flist=None, filename=None, key=None, root=None):
|
||||||
text.bind("<<open-new-window>>", self.flist.new_callback)
|
text.bind("<<open-new-window>>", self.flist.new_callback)
|
||||||
text.bind("<<close-all-windows>>", self.flist.close_all_callback)
|
text.bind("<<close-all-windows>>", self.flist.close_all_callback)
|
||||||
text.bind("<<open-class-browser>>", self.open_class_browser)
|
text.bind("<<open-class-browser>>", self.open_class_browser)
|
||||||
|
text.bind("<<open-path-browser>>", self.open_path_browser)
|
||||||
|
|
||||||
vbar['command'] = text.yview
|
vbar['command'] = text.yview
|
||||||
vbar.pack(side=RIGHT, fill=Y)
|
vbar.pack(side=RIGHT, fill=Y)
|
||||||
|
@ -313,6 +316,10 @@ def open_class_browser(self, event=None):
|
||||||
ClassBrowser.ClassBrowser(self.flist, base, [head])
|
ClassBrowser.ClassBrowser(self.flist, base, [head])
|
||||||
self.text["cursor"] = save_cursor
|
self.text["cursor"] = save_cursor
|
||||||
|
|
||||||
|
def open_path_browser(self, event=None):
|
||||||
|
import PathBrowser
|
||||||
|
PathBrowser.PathBrowser(self.flist)
|
||||||
|
|
||||||
def gotoline(self, lineno):
|
def gotoline(self, lineno):
|
||||||
if lineno is not None and lineno > 0:
|
if lineno is not None and lineno > 0:
|
||||||
self.text.mark_set("insert", "%d.0" % lineno)
|
self.text.mark_set("insert", "%d.0" % lineno)
|
||||||
|
|
Loading…
Reference in New Issue