本文整理汇总了Python中idlelib.EditorWindow.EditorWindow.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python EditorWindow.__init__方法的具体用法?Python EditorWindow.__init__怎么用?Python EditorWindow.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idlelib.EditorWindow.EditorWindow
的用法示例。
在下文中一共展示了EditorWindow.__init__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from idlelib.EditorWindow import EditorWindow [as 别名]
# 或者: from idlelib.EditorWindow.EditorWindow import __init__ [as 别名]
def __init__(self, *args):
self.breakpoints = []
EditorWindow.__init__(self, *args)
self.text.bind('<<set-breakpoint-here>>', self.set_breakpoint_here)
self.text.bind('<<clear-breakpoint-here>>', self.clear_breakpoint_here)
self.text.bind('<<open-python-shell>>', self.flist.open_shell)
self.breakpointPath = os.path.join(idleConf.GetUserCfgDir(), 'breakpoints.lst')
def filename_changed_hook(old_hook = self.io.filename_change_hook, self = self):
self.restore_file_breaks()
old_hook()
self.io.set_filename_change_hook(filename_changed_hook)
if self.io.filename:
self.restore_file_breaks()
示例2: __init__
# 需要导入模块: from idlelib.EditorWindow import EditorWindow [as 别名]
# 或者: from idlelib.EditorWindow.EditorWindow import __init__ [as 别名]
def __init__(self, *args):
EditorWindow.__init__(self, *args)
self.text.bind("<<goto-file-line>>", self.goto_file_line)
示例3: __init__
# 需要导入模块: from idlelib.EditorWindow import EditorWindow [as 别名]
# 或者: from idlelib.EditorWindow.EditorWindow import __init__ [as 别名]
def __init__(self, flist=None, interp=None, editwin=None):
EditorWindow.__init__(self, flist)
self.interp = interp
self.editwin = editwin
# TODO: figure out better way to eliminate menu bar
m = Menu(self.root)
self.top.config(menu=m)
root = self.top
self.doc_frame = doc_frame = Frame(root)
# make first line
f_top = Frame(doc_frame)
label = Label(f_top, text='Help on:')
self.entry = entry = Entry(f_top)
entry.bind('<Return>', self.get_doc)
self.update_calltip = IntVar(root)
check = Checkbutton(f_top, text='Update from Calltip',
variable=self.update_calltip)
check.var = self.update_calltip
if get_cfg('calltip'):
check.select()
f_top.pack(side='top', fill=X, padx=5)
label.pack(side='left')
entry.pack(side='left', fill=X, expand=True, padx=5, ipadx=5)
check.pack(side='right')
# make command buttons
f_cmd = Frame(doc_frame)
f_cmd.pack(side='top', fill=X, padx=3)
self.button_showdoc = Button(f_cmd, text='Show Doc String',
default='active',
command=self.get_doc)
self.button_showhelp = Button(f_cmd, text='Show help()',
command=self.get_help)
button_search = Button(f_cmd, text='Search Text',
command=self.search)
button_close = Button(f_cmd, text='Close',
command=self.close)
button_close.pack(side='right')
self.button_showdoc.pack(side='left')
self.button_showhelp.pack(side='left')
button_search.pack(side='left')
doc_frame.pack(side=TOP, before=self.text_frame, fill=X)
# change focused widget to entry box
self.entry.focus_set()
self.top.focused_widget = self.entry
# remove unneeded stuff
self.per.removefilter(self.undo)
self._rmcolorizer()
#self.status_bar.pack_forget()
# add a delegator to prevent editing of text widget
self.doc_del = DocDelegator()
self.doc_del.entry = self.entry
self.per.insertfilter(self.doc_del)
self.text._insert = self.doc_del.delegate.insert
self.text._delete = self.doc_del.delegate.delete
self.text.configure(wrap='none')
keySetName = idleConf.CurrentKeys()
find_bindings = idleConf.GetKeyBinding(keySetName, '<<find>>')
for key_event in find_bindings:
#self.entry.event_add('<<find>>', key_event)
self.entry.bind(key_event, lambda e: self.text.event_generate('<<find>>'))