From 4d6911cb29c2f88d1d99ba42343a27e63e097fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Eng=C3=A9libert?= Date: Sat, 12 Oct 2024 12:56:06 +0200 Subject: [PATCH] Initial commit --- README.md | 6 ++++++ editor.py | 22 ++++++++++++++++++++++ xlog.py | 9 +++++++++ 3 files changed, 37 insertions(+) create mode 100644 README.md create mode 100644 editor.py create mode 100644 xlog.py diff --git a/README.md b/README.md new file mode 100644 index 0000000..e9a2d97 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +https://code.activestate.com/recipes/579048-python-mandelbrot-fractal-with-tkinter/ +https://stackoverflow.com/questions/9886274/how-can-i-convert-canvas-content-to-an-image +https://tkdocs.com/tutorial/text.html +https://stackoverflow.com/questions/33084097/tkinter-really-all-complete-event-list +https://stackoverflow.com/questions/4172659/master-list-of-all-tkinter-events +https://www.tcl.tk/man/tcl8.5/TkCmd/bind.htm#M7 diff --git a/editor.py b/editor.py new file mode 100644 index 0000000..b76e2fb --- /dev/null +++ b/editor.py @@ -0,0 +1,22 @@ +import tkinter as tk + +root = tk.Tk() + +area = tk.Text() +area.pack() + +def diff(old, new): + index = 0 + if len(old) > len(new): + for i in range(len()): + pass + +def area_input(event): + #print(area.get("1.0", "end")) + print(event) + if event.keycode == 25: + area.mark_set("insert", "1.0") + +area.bind("", area_input) + +root.mainloop() diff --git a/xlog.py b/xlog.py new file mode 100644 index 0000000..3892180 --- /dev/null +++ b/xlog.py @@ -0,0 +1,9 @@ +import pygame + +pygame.font.init() + +font = pygame.font.SysFont('FreeMono', 16) + +def display(surface, lines): + for i in range(len(lines)): + surface.blit(font.render(lines[i], False, (255,255,255)), (0, i*20))