Esempio n. 1
0
def close(event):
    if len(editor.buffers()) == 1:
        quit()
    else:
        for buf in editor.buffers():
            if buf.is_untitled and buf.text not in '\n' and _asksavep():
                save()
            editor.forget(buf)
    editor.update_titlebar()
Esempio n. 2
0
def close(event):
    if len(editor.buffers()) == 1:
        quit()
    else:
        for buf in editor.buffers():
            if buf.is_untitled and buf.text not in '\n' and _asksavep():
                save()
            editor.forget(buf)
    editor.update_titlebar()
Esempio n. 3
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()
Esempio n. 4
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()