Skip to content

Commit

Permalink
Fixed the canvas sizing issue also adjusted the text box problem as w…
Browse files Browse the repository at this point in the history
…ell, I have also made myself aware of the fact that whenever a user interacts with the type box their results come out as double.
  • Loading branch information
Jonathan committed Dec 15, 2024
1 parent 7c2f4f4 commit ef23c28
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# Explicit imports to satisfy Flake8
"""
Alot of this code unironically, is from the import. Im doing research to understand what frameworks are used and to see if I can add anything to this code using them.
Alot of this code unironically, is from the import. Im doing research to understand what frameworks are used and to see if I can add anything to this code using the
"""

from tkinter import Tk, Canvas, Text, Button, PhotoImage
Expand All @@ -26,7 +26,7 @@ def relative_to_assets(path: str) -> Path:

# Initialize main Tkinter window
window = Tk()
window.geometry("700x400")
window.geometry("589x335")
window.configure(bg="#FFFFFF")

canvas = Canvas(
Expand All @@ -46,7 +46,7 @@ def relative_to_assets(path: str) -> Path:
canvas.create_rectangle(
294.0, 4.0, 589.0, 335.0, fill="#282828", outline="") # Rectangle 2
canvas.create_rectangle(
302.0, 16.0, 581.0, 329.0, fill="#202020", outline="")
302.0, 16.0, 540.0, 329.0, fill="#202020", outline="")
canvas.create_rectangle(
0.0, 4.0, 294.0, 41.0, fill="#535353", outline="") # Rectangle 1

Expand All @@ -63,12 +63,12 @@ def relative_to_assets(path: str) -> Path:
font=("Helvetica", 10),
relief="flat"
)
keystroke_output.place(x=302, y=16, width=279, height=313)
keystroke_output.place(x=302, y=16, width=250, height=313)

# Scroll functionality using Rectangle 1
scrollbar = Scrollbar(window, orient=VERTICAL, command=keystroke_output.yview)
scrollbar = Scrollbar(window, orient=VERTICAL, command=keystroke_output.yview,)
keystroke_output.config(yscrollcommand=scrollbar.set)
scrollbar.place(x=581, y=16, height=313)
scrollbar.place(x=570, y=16, height=313)

# Function to capture keystrokes and display them

Expand All @@ -78,7 +78,7 @@ def keyPressed(key):
keystroke_output.insert(END, char)
keystroke_output.see(END) # Auto-scroll to the end
except AttributeError:
special_key = f"[{key}]"
special_key = f" [{key}] "
keystroke_output.insert(END, special_key) # Handle special keys
keystroke_output.see(END)

Expand Down

0 comments on commit ef23c28

Please sign in to comment.