コード例 #1
0
ファイル: underline.py プロジェクト: Nazek42/pypad
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')
コード例 #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')
コード例 #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')
コード例 #4
0
ファイル: basics.py プロジェクト: scott91e1/pypad
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()
コード例 #5
0
ファイル: basics.py プロジェクト: Nazek42/pypad
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()
コード例 #6
0
ファイル: underline.py プロジェクト: Nazek42/pypad
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')
コード例 #7
0
ファイル: basics.py プロジェクト: scott91e1/pypad
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()
コード例 #8
0
ファイル: basics.py プロジェクト: Nazek42/pypad
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()
コード例 #9
0
ファイル: basics.py プロジェクト: scott91e1/pypad
def _asksavep():
    return askyesno("Save?", "Save %s?" % editor.buffer().path)
コード例 #10
0
ファイル: basics.py プロジェクト: Nazek42/pypad
def _asksavep():
    return askyesno("Save?", "Save %s?" % editor.buffer().path)
コード例 #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')
コード例 #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')
コード例 #13
0
ファイル: color.py プロジェクト: Nazek42/pypad
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')
コード例 #14
0
ファイル: color.py プロジェクト: Nazek42/pypad
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')