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


Python EditorWindow.EditorWindow类代码示例

本文整理汇总了Python中idlelib.EditorWindow.EditorWindow的典型用法代码示例。如果您正苦于以下问题:Python EditorWindow类的具体用法?Python EditorWindow怎么用?Python EditorWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了EditorWindow类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: edle

def edle(filename):
    root = Tk()
    fixwordbreaks(root)
    root.withdraw()
    edit = EditorWindow(root=root, filename=filename)
    edit.set_close_hook(root.quit)
    edit.text.bind("<<close-all-windows>>", edit.close_event)
    root.mainloop()
    root.destroy()
开发者ID:WilCrofter,项目名称:swirlypy_test_lessons,代码行数:9,代码来源:test.py

示例2: _close

 def _close(self):
     """Extend EditorWindow._close(), shut down debugger and execution server"""
     self.close_debugger()
     if use_subprocess:
         self.interp.kill_subprocess()
     sys.stdout = self.save_stdout
     sys.stderr = self.save_stderr
     sys.stdin = self.save_stdin
     self.interp = None
     self.console = None
     self.flist.pyshell = None
     self.history = None
     EditorWindow._close(self)
     return
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:14,代码来源:pyshell.py

示例3: __init__

    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,代码行数:15,代码来源:pyshell.py

示例4: close

 def close(self):
     """Extend EditorWindow.close()"""
     if self.executing:
         response = tkMessageBox.askokcancel('Kill?', 'The program is still running!\n Do you want to kill it?', default='ok', parent=self.text)
         if response is False:
             return 'cancel'
     self.stop_readline()
     self.canceled = True
     self.closing = True
     return EditorWindow.close(self)
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:10,代码来源:pyshell.py

示例5: close2

 def close2(self):
     return EditorWindow.close(self)
开发者ID:LinkedModernismProject,项目名称:web_code,代码行数:2,代码来源:PyShell.py

示例6: _close

 def _close(self):
     "Extend base method - clear breaks when module is closed"
     self.clear_file_breaks()
     EditorWindow._close(self)
开发者ID:LinkedModernismProject,项目名称:web_code,代码行数:4,代码来源:PyShell.py

示例7: __init__

 def __init__(self, *args):
     EditorWindow.__init__(self, *args)
     self.text.bind("<<goto-file-line>>", self.goto_file_line)
开发者ID:billtsay,项目名称:win-demo-opcua,代码行数:3,代码来源:OutputWindow.py

示例8: __init__

    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,代码行数:81,代码来源:DocViewer.py


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