def __init__(self, *args, **kwords): ScrolledText.__init__(self, *args, **kwords) if not ROScrolledText.tagInit: self.init_tag() bind_tags = tuple(tag if tag != "Text" else "ROScrolledText" for tag in self.bindtags()) self.bindtags(bind_tags)
def __init__(self, master=None, **kwargs): """ Constructor. Get default settings from user's IDLE configuration. """ currentTheme = idleConf.CurrentTheme() textcf = dict(padx=5, wrap='word', undo='True', foreground=idleConf.GetHighlight(currentTheme, 'normal', fgBg='fg'), background=idleConf.GetHighlight(currentTheme, 'normal', fgBg='bg'), highlightcolor=idleConf.GetHighlight(currentTheme, 'hilite', fgBg='fg'), highlightbackground=idleConf.GetHighlight(currentTheme, 'hilite', fgBg='bg'), insertbackground=idleConf.GetHighlight(currentTheme, 'cursor', fgBg='fg'), width=idleConf.GetOption('main', 'EditorWindow', 'width'), height=idleConf.GetOption('main', 'EditorWindow', 'height') ) fontWeight = 'normal' if idleConf.GetOption('main', 'EditorWindow', 'font-bold', type='bool'): fontWeight = 'bold' textcf['font'] = (idleConf.GetOption('main', 'EditorWindow', 'font'), idleConf.GetOption('main', 'EditorWindow', 'font-size'), fontWeight) # override defaults with any user-specified settings textcf.update(kwargs) ScrolledText.__init__(self, master, **textcf)
def __init__(self, master=None, **kwargs): """ Constructor. Get default settings from user's IDLE configuration. """ currentTheme = idleConf.CurrentTheme() textcf = dict( padx=5, wrap="word", undo="True", foreground=idleConf.GetHighlight(currentTheme, "normal", fgBg="fg"), background=idleConf.GetHighlight(currentTheme, "normal", fgBg="bg"), highlightcolor=idleConf.GetHighlight(currentTheme, "hilite", fgBg="fg"), highlightbackground=idleConf.GetHighlight(currentTheme, "hilite", fgBg="bg"), insertbackground=idleConf.GetHighlight(currentTheme, "cursor", fgBg="fg"), width=idleConf.GetOption("main", "EditorWindow", "width"), height=idleConf.GetOption("main", "EditorWindow", "height"), ) fontWeight = "normal" if idleConf.GetOption("main", "EditorWindow", "font-bold", type="bool"): fontWeight = "bold" textcf["font"] = ( idleConf.GetOption("main", "EditorWindow", "font"), idleConf.GetOption("main", "EditorWindow", "font-size"), fontWeight, ) # override defaults with any user-specified settings textcf.update(kwargs) ScrolledText.__init__(self, master, **textcf)
def __init__(self, master=None, **kwargs): ScrolledText.__init__(self, master, **kwargs) self.redirector = WidgetRedirector(self) self.insert = self.redirector.register("insert", lambda *args, **kw: "break") self.delete = self.redirector.register("delete", lambda *args, **kw: "break")
def __init__(self, master=None, **kwargs): """ Initializer. Get default settings from user's IDLE configuration. """ currentTheme = idleConf.CurrentTheme() textcf = { 'padx': 5, 'wrap': 'word', 'undo': 'True', 'foreground': idleConf.GetHighlight( currentTheme, 'normal', fgBg='fg'), 'background': idleConf.GetHighlight( currentTheme, 'normal', fgBg='bg'), 'highlightcolor': idleConf.GetHighlight( currentTheme, 'hilite', fgBg='fg'), 'highlightbackground': idleConf.GetHighlight( currentTheme, 'hilite', fgBg='bg'), 'insertbackground': idleConf.GetHighlight( currentTheme, 'cursor', fgBg='fg'), 'width': idleConf.GetOption('main', 'EditorWindow', 'width'), 'height': idleConf.GetOption('main', 'EditorWindow', 'height'), } fontWeight = 'normal' if idleConf.GetOption('main', 'EditorWindow', 'font-bold', type='bool'): fontWeight = 'bold' textcf['font'] = (idleConf.GetOption('main', 'EditorWindow', 'font'), idleConf.GetOption('main', 'EditorWindow', 'font-size'), fontWeight) # override defaults with any user-specified settings textcf.update(kwargs) ScrolledText.__init__(self, master, **textcf)
def __init__(self, *args, **kwargs): """A text widget that report on internal widget commands""" ST.__init__(self, *args, **kwargs) # create a proxy for the underlying widget self._orig = self._w + "_orig" self.tk.call("rename", self._w, self._orig) self.tk.createcommand(self._w, self._proxy)
def __init__(self, parent=None): self.data_queue = Queue() ScrolledText.__init__(self, parent) self.pack() self.bind('<Button-1>', self.make_threads) self.consumer()
def __init__(self, *args, **kwargs): ScrolledText.__init__(self, *args, **kwargs) self.config(bg="#e6ebf4") self.pack(expand=1, fill="both") self.bind("<1>", lambda event: self.focus_set()) # разрешить копирование self.configure(state="disabled") for color in ['red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'pink']: self.tag_configure(color, foreground=color, font=("Courier", "11", "bold"))
def __init__(self, master, **kw): ScrolledText.__init__(self, master, **kw) self.bind("<Key>", lambda x: "break") self.tag_config("url", foreground="blue", underline=1) self.tag_bind("url", "<Enter>", self._enter) self.tag_bind("url", "<Leave>", self._leave) self.tag_bind("url", "<Button-1>", self._open_url) self.tag_bind("url", "<Button-3>", self._copy)
def __init__(self, parent, *args, **kwargs): self.textvariable = kwargs.pop("textvariable", None) # Remote tk.StringVar ScrolledText.__init__(self, parent, *args, **kwargs) # Generally, we respond when remote is updated. Unless WE are # the one who updated it... self.watch_remote = True self.watch_local = True # Notice when remote variable changes: self.textvariable.trace("w", self.remote_change_callback) # Notice when local content changes: self.bind("<<Modified>>", self.on_text_modified)
def __init__(self, master=None, **cnf): # Initialize base class ScrolledText.__init__(self, master, **cnf) # Define tags for formatting styles self.tag_config('X', underline=1) self.tag_config('!', font=BOLDFONT) self.tag_config('_', font=ITALICFONT) # Set state to idle self.fp = None self.lineno = 0
def __init__(self, master=None, **cnf): # Initialize base class ScrolledText.__init__(self, master, **cnf) # Define tags for formatting styles self.tag_config("X", underline=1) self.tag_config("!", font=BOLDFONT) self.tag_config("_", font=ITALICFONT) # Set state to idle self.fp = None self.lineno = 0
def __init__(self, windoe, file, winX: int, winY: int): ScrolledText.__init__(self, windoe, width="37", bg=BGCOLOR, fg=FGCOLOR, font="4", wrap=WORD, highlightthickness=1, highlightbackground=FGCOLOR, highlightcolor=FGCOLOR) self.insert(END, bxInstruct.instFetch('S_PG1.md')) placeX = winX - 272 placeY = winY - 363 self.place(x=placeX, y=placeY)
def __init__(self, file=None, text="", parent=None, **kw): if parent is None: self.parent = editor else: self.parent = parent ScrolledText.__init__(self, parent, **kw) if file is None: self.is_untitled = True self._file = tempfile.NamedTemporaryFile(mode="w+t", prefix=UNTITLED) else: self.is_untitled = False self._file = file self.text = text
def __init__(self, master=None, **cnf): ScrolledText.__init__(self, master, **cnf) bold = Font(font=self['font']).copy() bold.config(weight='bold') italic = Font(font=self['font']).copy() italic.config(slant='italic') # Define tags for formatting styles self.tag_config('X', underline=1) self.tag_config('!', font=bold) self.tag_config('_', font=italic) # Set state to idle self.fp = None self.lineno = 0
def __init__(self, file=None, text="", parent=None, **kw): if parent is None: self.parent = editor else: self.parent = parent ScrolledText.__init__(self, parent, **kw) if file is None: self.is_untitled = True self._file = tempfile.NamedTemporaryFile(mode='w+t', prefix=UNTITLED) else: self.is_untitled = False self._file = file self.text = text
def __init__(self, master=None, shell=None, **cnf): if not shell: try: shell = os.environ['SHELL'] except KeyError: shell = '/bin/sh' shell = shell + ' -i' args = string.split(shell) shell = args[0] ScrolledText.__init__(self, master, **cnf) self.pos = '1.0' self.bind('<Return>', self.inputhandler) self.bind('<Control-c>', self.sigint) self.bind('<Control-t>', self.sigterm) self.bind('<Control-k>', self.sigkill) self.bind('<Control-d>', self.sendeof) self.pid, self.fromchild, self.tochild = spawn(shell, args) self.tk.createfilehandler(self.fromchild, READABLE, self.outputhandler)
def __init__(self, master=None, **kwargs): """ Initializer. Get default settings from user's IDLE configuration. """ textcf = self._initialize_config(idleConf.CurrentTheme()) if idleConf.GetOption('main', 'EditorWindow', 'font-bold', type='bool'): font_weight = 'bold' else: font_weight = 'normal' textcf['font'] = (idleConf.GetOption('main', 'EditorWindow', 'font'), idleConf.GetOption('main', 'EditorWindow', 'font-size'), font_weight) # override defaults with any user-specified settings textcf.update(kwargs) ScrolledText.__init__(self, master, **textcf)
def __init__(self, master=None, **opt): opt.setdefault('width', 80) opt.setdefault('height', 24) opt.setdefault('background', 'gray92') # 'cornsilk', 'FloralWhite' opt.setdefault('foreground', 'DarkGreen') opt.setdefault('font', ('Consolas', 9, 'normal')) self.initfile = opt.pop('initfile', None) self.history = [] self.write_lock = Lock() ScrolledText.__init__(self, master, **opt) self.pack(side=TOP, fill=BOTH, expand=True) self._prompt = "? " self.text_init(opt) self.bindings() self.prompt() self.write_end( "Welcome to Expression Evaluator: Cheap Edition.\nUse \"exit\" to exit console.\n", ('welcome', )) self.focus_set()
def __init__(self, master=None, **opt): opt.setdefault('width', 80) opt.setdefault('height', 24) opt.setdefault('background', 'gray92') # 'cornsilk', 'FloralWhite' opt.setdefault('foreground', 'DarkGreen') opt.setdefault('font', ('Consolas', 9, 'normal')) self.initfile = opt.pop('initfile', None) self.history = [] self.complete = rlcompleter.Completer(globals()).complete self.write_lock = Lock() ScrolledText.__init__(self, master, **opt) self.pack(side=TOP, fill=BOTH, expand=True) self.text_init(opt) self.bindings() sys.stdout = StdoutRedirector(self) sys.stderr = StderrRedirector(self) self.prompt() self.write_end(welcome_text, ('welcome', )) self.focus_set() self.run_initfile()
def __init__(self, parent: Frame, get_prompt: Callable[[], str] = None): ScrolledText.__init__(self, parent, **self.get_text_options()) self.console_tags = [] # Set the getter of the command prompt self.get_prompt = get_prompt or get_cmd_invite # Make edits that occur during on_text_change not cause it to trigger again def on_modified(event: Event): flag = self.edit_modified() if flag: self.after(10, self.on_text_change(event)) self.edit_modified(False) self.bind("<<Modified>>", on_modified) self.committed_hash = None self.committed_text_backup = "" self.commit_all() self.mark_set("prompt_end", 1.0) # Aspects des �l�ments du prompt self.tag_config("prompt_user", foreground="#5FD300", selectbackground="#5FD300", selectforeground="black") self.tag_config("prompt_host", foreground="#4E9A06", selectbackground="#4E9A06", selectforeground="black") self.tag_config("prompt_cwd", foreground="#EA2E00", selectbackground="#EA2E00", selectforeground="black") self.tag_config("prompt_@", foreground="white", selectbackground="white", selectforeground="black") self.tag_config("prompt_:", foreground="white", selectbackground="white", selectforeground="black") self.tag_config("prompt_$", foreground="white", selectbackground="white", selectforeground="black")
def __init__(self, *args, **kwargs): ScrolledText.__init__(self, *args, **kwargs) self.config(bg="#a7bbe2") self.pack(fill="both") self.configure(state="disabled") self.configure(font=("Helvetica", 13))
def __init__(self, parent=None): ScrolledText.__init__(self, parent) self.pack() self.dataQueue = queue.Queue() self.bind('<Button-1>', self.makethreads) self.consumer()
def __init__(self, parent=None): ScrolledText.__init__(self, parent) self.pack() self.dataQueue = queue.Queue() # infinite size self.bind('<Button-1>', self.makethreads) # on left mouse click self.consumer() # queue loop in main thread
def __init__(self, *args, **kwargs): ScrolledText.__init__(self, *args, **kwargs) self._orig = self._w + '_orig' self.tk.call('rename', self._w, self._orig) self.tk.createcommand(self._w, self._proxy)
def __init__(self, parent): """Initialize our console, that inherits from ScrollText (which is just a tk.Text and Scrollbar).""" self.parent = parent ScrolledText.__init__(self, self.parent)
def __init__(self, master, *args, **kwargs): ScrolledText.__init__(self, master, *args, **kwargs) TextIOBase.__init__(self) self.configure(state="disabled")
def __init__(self, parent): ScrolledText.__init__(self, parent, height=8, width=44)
def __init__(self, parent=None): ScrolledText.__init__(self, parent) self.pack() self.dataQueue = queue.Queue() self.bind('<Button-1>', lambda event: self.makethreads(event)) self.consumer()
def __init__(self, *args, **kwargs): ScrolledText.__init__(self, *args, **kwargs)
def __init__(self, master=None, **kwargs): ScrolledText.__init__(self, master, **kwargs) Diacritical.__init__(self)