Ejemplo n.º 1
0
def uoff(event):
    global _i
    buf = editor.buffer()
    tagname = 'underline.underline-%d' % _i
    _i += 1
    buf.tag_config(tagname, underline=False)
    buf.tag_add(tagname, 'sel.first', 'sel.last')
Ejemplo n.º 2
0
def uoff(event):
    global _i
    buf = editor.buffer()
    tagname = 'underline.underline-%d' % _i
    _i += 1
    buf.tag_config(tagname, underline=False)
    buf.tag_add(tagname, 'sel.first', 'sel.last')
Ejemplo n.º 3
0
def uon(event):
    global _i
    print("hi")
    buf = editor.buffer()
    tagname = 'underline.underline-%d' % _i
    _i += 1
    buf.tag_config(tagname, underline=True)
    buf.tag_add(tagname, 'sel.first', 'sel.last')
Ejemplo n.º 4
0
def quit():
    for i in editor.tabs():
        editor.select(i)
        buf = editor.buffer()
        #print("DEBUG: buf.path => |%s|" % buf.path)
        if buf.is_untitled and buf.text not in '\n' and _asksavep():
            save()
    root.destroy()
Ejemplo n.º 5
0
def quit():
    for i in editor.tabs():
        editor.select(i)
        buf = editor.buffer()
        #print("DEBUG: buf.path => |%s|" % buf.path)
        if buf.is_untitled and buf.text not in '\n' and _asksavep():
            save()
    root.destroy()
Ejemplo n.º 6
0
def uon(event):
    global _i
    print("hi")
    buf = editor.buffer()
    tagname = 'underline.underline-%d' % _i
    _i += 1
    buf.tag_config(tagname, underline=True)
    buf.tag_add(tagname, 'sel.first', 'sel.last')
Ejemplo n.º 7
0
def save(event=None):
    buf = editor.buffer()
    if buf.is_untitled:
        path = asksaveasfilename()
        # If the user clicked 'Cancel', return without changing anything.
        if not path:
            return
        buf.path = path

    buf.flush()
    editor.update_titlebar()
    editor.update_tabs()
Ejemplo n.º 8
0
def save(event=None):
    buf = editor.buffer()
    if buf.is_untitled:
        path = asksaveasfilename()
        # If the user clicked 'Cancel', return without changing anything.
        if not path:
            return
        buf.path = path

    buf.flush()
    editor.update_titlebar()
    editor.update_tabs()
Ejemplo n.º 9
0
def _asksavep():
    return askyesno("Save?", "Save %s?" % editor.buffer().path)
Ejemplo n.º 10
0
def _asksavep():
    return askyesno("Save?", "Save %s?" % editor.buffer().path)
Ejemplo n.º 11
0
def fgcolor(event):
    color_code = askcolor()[1]  # Ex. '#00cc00'
    if not color_code: return
    tagname = 'color.fgcolor-%s' % color_code  # Ex: 'color.fgcolor-#00cc00'
    editor.buffer().tag_config(tagname, foreground=color_code)
    editor.buffer().tag_add(tagname, 'sel.first', 'sel.last')
Ejemplo n.º 12
0
def bgcolor(event):
    color_code = askcolor()[1]
    if not color_code: return
    tagname = 'color.bgcolor-%s' % color_code
    editor.buffer().tag_config(tagname, background=color_code)
    editor.buffer().tag_add(tagname, 'sel.first', 'sel.last')
Ejemplo n.º 13
0
def fgcolor(event):
    color_code = askcolor()[1] # Ex. '#00cc00'
    if not color_code: return
    tagname = 'color.fgcolor-%s' % color_code# Ex: 'color.fgcolor-#00cc00'
    editor.buffer().tag_config(tagname, foreground=color_code)
    editor.buffer().tag_add(tagname, 'sel.first', 'sel.last')
Ejemplo n.º 14
0
def bgcolor(event):
    color_code = askcolor()[1]
    if not color_code: return
    tagname = 'color.bgcolor-%s' % color_code
    editor.buffer().tag_config(tagname, background=color_code)
    editor.buffer().tag_add(tagname, 'sel.first', 'sel.last')