Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(BP-67) Tkinter GUI can start new game block editor instance #44

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions flask/Pipfile
@@ -0,0 +1,13 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
flask = "*"
flask-cors = "*"

[dev-packages]

[requires]
python_version = "3.12"
152 changes: 152 additions & 0 deletions flask/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion home/homeScreenGui.py
@@ -1,5 +1,12 @@
import tkinter as tk
from tkinter import Canvas, Frame, Scrollbar, Label
import webbrowser

#Opening an instance of the code editor
def open_code_editor():
link = 'http://localhost:5000'
webbrowser.open(link)


# Methods that displays border colors if the mouse hover over clickable widgets
def on_enter(e, widget):
Expand Down Expand Up @@ -34,7 +41,7 @@ def display_game_info(game_info_container, game_name):
play_button.bind("<Enter>", lambda e, widget=play_button: on_enter(e, widget))
play_button.bind("<Leave>", lambda e, widget=play_button: on_leave(e, widget))

edit_button = tk.Button(button_frame, text="Edit", bg="blue", fg="white")
edit_button = tk.Button(button_frame, text="Edit", bg="blue", fg="white", command=open_code_editor) # When clicked, a new code editor istance is made in a new web browser tab.
edit_button.pack(side=tk.LEFT, padx=5, pady=5, ipadx=20, ipady=20) # Same internal padding for square shape
edit_button.bind("<Enter>", lambda e, widget=edit_button: on_enter(e, widget))
edit_button.bind("<Leave>", lambda e, widget=edit_button: on_leave(e, widget))
Expand Down