0

I am trying to follow this tutorial: https://www.youtube.com/watch?v=OqbGRZx4xUc, to code up a game. I'm using macOS, and python on VScode. This is what I have coded so far:

from tkinter import *




root = Tk()
root.configure(bg="black")
root.geometry('1440x720')
root.title("Minesweeper game")
root.resizable(False, False)


top_frame = Frame(root, bg='red', width=180, height=100)

top_frame.place(x=0, y=0, relwidth=1.0)  

root.mainloop()

this is all I have coded so far, however, my background colour doesn't change and even the frame doesn't show up. any clue why this may happen? I literally copied the code from the tutorial

3
  • 1
    This should help: tkinter on mac I read a lot about problems with the preinstalled python and tkinter on mac os, so you might just have to update your installation. Your code works fine Commented Dec 16, 2023 at 13:04
  • Does this help from tkinter import ttk instead of from tkinter import *? Commented Dec 16, 2023 at 14:45
  • Your frame has a height of 0. top_frame.place(x=0, y=0, relwidth=1.0, relheight=1.0) Commented Dec 23, 2023 at 21:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.