0

I have a code like the following:

import pygame
import pygame_menu

pygame.init()
screen = pygame.display.set_mode((1000, 1000), pygame.RESIZABLE)
screen.fill((255, 255, 255))
menu = pygame_menu.Menu(
    height=400,
    width=600,
    title="Title"
)

for letter in 'abcdefghijklmnopqrstuvwxyz':
    menu.add.label(letter)

menu.mainloop(screen)

My pygame_menu and pygame are the newest version, just installed them both about an hour ago, I cannot figure out why it keeps giving me: Traceback (most recent call last): File "C:\Users\Yun Fei\Desktop\SFU\CMPT 403\Assignment 2\unencrypt.py", line 14, in menu.add_label(letter) ^^^^^^^^^^^^^^ AttributeError: 'Menu' object has no attribute 'add_label'

Edit: The error has been fixed after I changed the code, however now it just shows a black screen after which it freezes?

Rabbid76
  • 202,892
  • 27
  • 131
  • 174
chen
  • 167
  • 9

0 Answers0