Skip to content

Commit

Permalink
agrege eventos de teclado
Browse files Browse the repository at this point in the history
  • Loading branch information
janselroa committed Mar 3, 2021
1 parent 9f45a26 commit ae8261a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def save_file():
file.write(content)
root.title(f"Archivo guardado en {url_file} {TITLE}")

def save_file_as():
def save_file_as(event=None):
global url_file
url_file = f.asksaveasfile(initialdir='.', filetypes=[("Archivos de texto", "*.txt"), ("Otros", "*")], title="Guardar archivo como")
content = text.get(1.0, "end-1c")
Expand Down Expand Up @@ -89,18 +89,23 @@ def cortar():
text.delete("sel.first", "sel.last")


def deshacer():
def deshacer(event=None):

text.edit_undo()


def rehacer():
def rehacer(envent=None):

text.edit_redo()

def fuente(a):
text.config(font=a)

#eventos de teclado

root.bind('<Control-s>', save_file_as)
root.bind('<Control-z>', deshacer)
root.bind('<Control-y>', rehacer)

# Menú
bar = Menu(root)
Expand Down
Binary file added src/menu/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file modified src/menu/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file added src/menu/__pycache__/about.cpython-38.pyc
Binary file not shown.
Binary file modified src/menu/__pycache__/about.cpython-39.pyc
Binary file not shown.

0 comments on commit ae8261a

Please sign in to comment.