当前位置: 首页>>代码示例>>Python>>正文


Python EditorWindow.__init__方法代码示例

本文整理汇总了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()
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:17,代码来源:pyshell.py

示例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)
开发者ID:billtsay,项目名称:win-demo-opcua,代码行数:5,代码来源:OutputWindow.py

示例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>>'))
开发者ID:CWade3051,项目名称:Py,代码行数:83,代码来源:DocViewer.py


注:本文中的idlelib.EditorWindow.EditorWindow.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。