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


Python ScrolledText.ScrolledText方法代码示例

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


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

示例1: initialize

# 需要导入模块: import ScrolledText [as 别名]
# 或者: from ScrolledText import ScrolledText [as 别名]
def initialize(self):
        """
        Set window layout.
        """
        self.grid()

        self.respond = ttk.Button(self, text='Get Response', command=self.get_response)
        self.respond.grid(column=0, row=0, sticky='nesw', padx=3, pady=3)

        self.usr_input = ttk.Entry(self, state='normal')
        self.usr_input.grid(column=1, row=0, sticky='nesw', padx=3, pady=3)

        self.conversation_lbl = ttk.Label(self, anchor=tk.E, text='Conversation:')
        self.conversation_lbl.grid(column=0, row=1, sticky='nesw', padx=3, pady=3)

        self.conversation = ScrolledText.ScrolledText(self, state='disabled')
        self.conversation.grid(column=0, row=2, columnspan=2, sticky='nesw', padx=3, pady=3) 
开发者ID:gunthercox,项目名称:ChatterBot,代码行数:19,代码来源:tkinter_gui.py

示例2: add_listener

# 需要导入模块: import ScrolledText [as 别名]
# 或者: from ScrolledText import ScrolledText [as 别名]
def add_listener(self, taskno):
        "There is a ScrolledText for each task"
        st = ScrolledText(self.root, height=5)
        st.insert('end', 'Output of task %d\n' % taskno)
        st.pack()
        self.widgets[taskno] = st 
开发者ID:micheles,项目名称:plac,代码行数:8,代码来源:plac_tk.py

示例3: add_new_clip

# 需要导入模块: import ScrolledText [as 别名]
# 或者: from ScrolledText import ScrolledText [as 别名]
def add_new_clip(self):
        '''
         destroy frames and add with new clip added
        '''
        for frame in self.frames:
            frame.destroy()

        self.frames = []
        self.textBoxes = []
        self.no_of_clips = len(utils.clips)

        for clip, i in zip(reversed(utils.clips), range(len(utils.clips))):

            frame = Frame(self.mainFrame, padx=5,
                          pady=5, bg=self.colors[i % 3])

            Button(frame, text="clip it ", font="Helvetica 12 bold",
                   command=partial(self.copy_to_clipboard, i), relief=RAISED,
                   padx=3, pady=3, bg='dark violet', fg='white').grid(
                       row=0, column=0, ipady=2
                   )

            Button(frame, text="delete", font="Helvetica 12 bold",
                   command=partial(self.delete_frame, len(utils.clips)-i-1),
                   relief=RAISED,
                   padx=3, pady=3, bg='red', fg='white').grid(
                       row=1, column=0, ipady=2
                   )

            textBox = ScrolledText(frame, height=4, width=20,
                                   font="Helvetica 12 bold")
            textBox.insert(END, clip)

            textBox.grid(row=0, column=1, rowspan=2, sticky=E, padx=5)
            self.textBoxes.append(textBox)

            self.no_of_clips = len(utils.clips)

            frame.pack(fill='both', expand=True, pady=5)
            self.frames.append(frame) 
开发者ID:nikhilkumarsingh,项目名称:clix,代码行数:42,代码来源:gui.py

示例4: root

# 需要导入模块: import ScrolledText [as 别名]
# 或者: from ScrolledText import ScrolledText [as 别名]
def root(Text):
    global ReturnText
    root = Tkinter.Tk(className="SimplyTemplate Test Editor")
    textPad = ScrolledText.ScrolledText(
        root, width=100, height=15)  # creates text area
    menu = Menu(root)
    root.config(menu=menu)
    filemenu = Menu(menu)
    menu.add_cascade(label="File", menu=filemenu)
    filemenu.add_command(
        label="Save", command=lambda: save_command(textPad, root))
    filemenu.add_separator()
    filemenu.add_command(label="Exit", command=lambda: exit_command(root))
    helpmenu = Menu(menu)
    menu.add_cascade(label="Help", menu=helpmenu)
    helpmenu.add_command(label="About...", command=about_command)
    # end of menu creation
    textPad.pack()
    build(textPad, Text)
    root.mainloop()
    try:
        if ReturnText:
            return ReturnText
    except:
        print " [!] No text returned / changed"
        pass 
开发者ID:SimplySecurity,项目名称:SimplyTemplate,代码行数:28,代码来源:TemplateEdit.py

示例5: create_destroyDebugTracing

# 需要导入模块: import ScrolledText [as 别名]
# 或者: from ScrolledText import ScrolledText [as 别名]
def create_destroyDebugTracing(self, *args):
    	# test creating tracing/debug window
    	
    	if (self.dbgTracing):
    		self.dbgTracing.destroy()
    		self.dbgTracing = None
    		self.debug = False

    	else:
	        try:
	            # have in its own special di decial class
	            self.dbgTracing = Tkinter.Toplevel()
	            self.dbgTracing.title("Tracing/Debug")
	            dbgTraceFrame2 = Tkinter.Frame(self.dbgTracing)
	            dbgTraceFrame2.pack(side='top', fill='x')
	            dbgTraceFrame = Tkinter.Frame(self.dbgTracing)
	            dbgTraceFrame.pack(side='top', fill='x',expand='yes')
	            self.traceWindow = ScrolledText(dbgTraceFrame, background='#f4f4f4',
	                                              foreground='#aa0000', width=45, height=24, wrap='none')
	
	            Tkinter.Button(dbgTraceFrame2, text='clear',
	                           background='#a0c0c0', foreground='black',
	                           command= lambda start=1.0, end=Tkinter.END : self.traceWindow.delete(start,end)
	                           ).pack(side='right')
	            Tkinter.Button(dbgTraceFrame2, text='Save',
	                           background='#a0c0c0', foreground='black',
	                           command= lambda file=self.kimmoResultFile,windowName=self.traceWindow,mode='w',auto=0 : self.writeToFilefromWindow(file,windowName,mode,auto)
	                           ).pack(side='left')
	
	
	            scroll = Tkinter.Scrollbar(dbgTraceFrame, orient='horizontal',command=self.traceWindow.xview)
	            scroll.pack(side='bottom', fill='x')
	
	            self.traceWindow.configure(xscrollcommand = scroll.set)
	            self.traceWindow.pack(side='bottom')
	
	
	            self.debug = True
	
	            # this will automatically clean itself up.
	            self.dbgTracing.protocol("WM_DELETE_WINDOW", self.create_destroyDebugTracing)
	
	        except:
	            print 'Error creating Tree View'
	            self.dbgTracing.destroy()
	            self.dbgTracing = None
	            self.debug = False
	            raise 
开发者ID:rafasashi,项目名称:razzy-spinner,代码行数:50,代码来源:kimmo.py

示例6: __init__

# 需要导入模块: import ScrolledText [as 别名]
# 或者: from ScrolledText import ScrolledText [as 别名]
def __init__(self):
        root = tk.Tk()
        root.title('OpenCV Demo')

        self.win = win = tk.PanedWindow(root, orient=tk.HORIZONTAL, sashrelief=tk.RAISED, sashwidth=4)
        self.win.pack(fill=tk.BOTH, expand=1)

        left = tk.Frame(win)
        right = tk.Frame(win)
        win.add(left)
        win.add(right)

        scrollbar = tk.Scrollbar(left, orient=tk.VERTICAL)
        self.demos_lb = demos_lb = tk.Listbox(left, yscrollcommand=scrollbar.set)
        scrollbar.config(command=demos_lb.yview)
        scrollbar.pack(side=tk.RIGHT, fill=tk.Y)
        demos_lb.pack(side=tk.LEFT, fill=tk.BOTH, expand=1)

        self.samples = {}
        for fn in glob('*.py'):
            name = splitfn(fn)[1]
            if fn[0] != '_' and name not in exclude_list:
                demos_lb.insert(tk.END, name)
                self.samples[name] = fn
        demos_lb.bind('<<ListboxSelect>>', self.on_demo_select)

        self.cmd_entry = cmd_entry = tk.Entry(right)
        cmd_entry.bind('<Return>', self.on_run)
        run_btn = tk.Button(right, command=self.on_run, text='Run', width=8)

        self.text = text = ScrolledText(right, font=('arial', 12, 'normal'), width = 30, wrap='word')
        self.linker = linker = LinkManager(text, self.on_link)
        self.text.tag_config("header1", font=('arial', 14, 'bold'))
        self.text.tag_config("header2", font=('arial', 12, 'bold'))
        text.config(state='disabled')

        text.pack(fill='both', expand=1, side=tk.BOTTOM)
        cmd_entry.pack(fill='x', side='left' , expand=1)
        run_btn.pack() 
开发者ID:fatcloud,项目名称:PyCV-time,代码行数:41,代码来源:demo.py

示例7: __init__

# 需要导入模块: import ScrolledText [as 别名]
# 或者: from ScrolledText import ScrolledText [as 别名]
def __init__(self):
        root = tk.Tk()
        root.title('OpenCV Demo')

        self.win = win = tk.PanedWindow(root, orient=tk.HORIZONTAL, sashrelief=tk.RAISED, sashwidth=4)
        self.win.pack(fill=tk.BOTH, expand=1)

        left = tk.Frame(win)
        right = tk.Frame(win)
        win.add(left)
        win.add(right)

        scrollbar = tk.Scrollbar(left, orient=tk.VERTICAL)
        self.demos_lb = demos_lb = tk.Listbox(left, yscrollcommand=scrollbar.set)
        scrollbar.config(command=demos_lb.yview)
        scrollbar.pack(side=tk.RIGHT, fill=tk.Y)
        demos_lb.pack(side=tk.LEFT, fill=tk.BOTH, expand=1)

        self.samples = {}
        for fn in glob('*.py'):
            name = splitfn(fn)[1]
            if fn[0] != '_' and name not in exclude_list:
                self.samples[name] = fn

        for name in sorted(self.samples):
            demos_lb.insert(tk.END, name)

        demos_lb.bind('<<ListboxSelect>>', self.on_demo_select)

        self.cmd_entry = cmd_entry = tk.Entry(right)
        cmd_entry.bind('<Return>', self.on_run)
        run_btn = tk.Button(right, command=self.on_run, text='Run', width=8)

        self.text = text = ScrolledText(right, font=('arial', 12, 'normal'), width = 30, wrap='word')
        self.linker = linker = LinkManager(text, self.on_link)
        self.text.tag_config("header1", font=('arial', 14, 'bold'))
        self.text.tag_config("header2", font=('arial', 12, 'bold'))
        text.config(state='disabled')

        text.pack(fill='both', expand=1, side=tk.BOTTOM)
        cmd_entry.pack(fill='x', side='left' , expand=1)
        run_btn.pack() 
开发者ID:makelove,项目名称:OpenCV-Python-Tutorial,代码行数:44,代码来源:demo.py


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