Skip to content

Commit 1ab7e3f

Browse files
Minor Update to Set Numbers Button and Label Placement
1 parent 3676400 commit 1ab7e3f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

SteamRoulette.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,17 @@ def __init__(self, root, installed_games, drives):
234234
self.button_store = tk.Button(utility_frame, text="Go to Steam Store", command=self.open_store, state=tk.DISABLED, font=("Arial", 12))
235235
self.button_store.grid(row=1, column=1, pady=5, padx=4)
236236

237+
# Create a container frame to hold the button and label
238+
self.frame_controls = tk.Frame(self.root)
239+
self.frame_controls.place(relx=0.0, rely=0.85, anchor='w')
240+
237241
# Add a button that triggers the popup to input the number of games
238-
self.button_set_number_of_games = tk.Button(self.root, text="Set Number of Games", command=self.set_number_of_games)
239-
self.button_set_number_of_games.place(relx=0.0, rely=0.76, anchor='w') # Positioned below canvas on the left
242+
self.button_set_number_of_games = tk.Button(self.frame_controls, text="Set Number of Games", command=self.set_number_of_games)
243+
self.button_set_number_of_games.grid(row=0, column=0, sticky='w', pady=5) # Positioned within the frame
240244

241245
# Label to show the number of games selected (initially empty)
242-
self.label_number_of_games = tk.Label(self.root, text="Number of games: All Games", font=("Arial", 8))
243-
self.label_number_of_games.place(relx=0.0, rely=0.8, anchor='w') # Positioned below the button
246+
self.label_number_of_games = tk.Label(self.frame_controls, text="Number of games: All Games", font=("Arial", 8))
247+
self.label_number_of_games.grid(row=1, column=0, sticky='w')
244248

245249
self.active_images = []
246250
self.selected_game_image = None
@@ -476,7 +480,7 @@ def submit_number_of_games(self):
476480
self.popup.destroy()
477481

478482
# Update the button text to "Spin Wheel" once the number is set
479-
self.button_spin.config(state=tk.NORMAL, text="Spin Wheel")
483+
self.button_spin.config(state=tk.NORMAL, text="Spin the Wheel")
480484

481485
except ValueError as e:
482486
# If input is invalid, show an error message
@@ -676,7 +680,7 @@ def display_selected_game(self):
676680
self.canvas.image = img_tk # Keep reference to prevent garbage collection
677681

678682
# Re-enable the buttons and re-enable the "Re-roll" button with correct text
679-
self.button_spin.config(state=tk.NORMAL, text="Re-roll")
683+
self.button_spin.config(state=tk.NORMAL, text="Re-Roll")
680684
self.button_launch.config(state=tk.NORMAL)
681685
self.button_store.config(state=tk.NORMAL)
682686

0 commit comments

Comments
 (0)