Skip to content

9.x AttributeError: 'Display' object has no attribute 'show' #8499

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

Closed
ladyada opened this issue Oct 21, 2023 · 4 comments · Fixed by #8517
Closed

9.x AttributeError: 'Display' object has no attribute 'show' #8499

ladyada opened this issue Oct 21, 2023 · 4 comments · Fixed by #8517

Comments

@ladyada
Copy link
Member

ladyada commented Oct 21, 2023

CircuitPython version

Adafruit CircuitPython 9.0.0-alpha.1-77-g2c47221cac on 2023-10-21; Adafruit Camera with ESP32S3

Code/REPL

def init_display(self):
        # construct displayio by hand
        displayio.release_displays()        
        self._display_bus = displayio.FourWire(self._spi, command=board.TFT_DC,
                                               chip_select=board.TFT_CS,
                                               reset=board.TFT_RESET,
                                               baudrate=60_000_000)
        self.display = board.DISPLAY
        # init specially since we are going to write directly below
        self.display = displayio.Display(self._display_bus, self._INIT_SEQUENCE,
                                         width=240, height=240, colstart=80,
                                         auto_refresh=False)
        print(dir(self.display))
        self.display.show(self.splash)
        self.display.refresh()

Behavior

AttributeError: 'Display' object has no attribute 'show'

print(dir(self.display))
['__class__', 'auto_refresh', 'brightness', 'bus', 'fill_row', 'height', 'refresh', 'root_group', 'rotation', 'width']

Description

scott mentioned this and there's no existing issue (that is aw) so we can have one here!

Additional information

No response

@ladyada ladyada added the bug label Oct 21, 2023
@RetiredWizard
Copy link

RetiredWizard commented Oct 21, 2023

I thought .show was depreciated in 8.x and removed in 9.x?

#8456

@ladyada
Copy link
Member Author

ladyada commented Oct 21, 2023

ooh ok that maybe what im forgetting!

@DJDevon3
Copy link

show is still valid in 8.x and will be the last version it is valid.
transitioning to total deprecation of display.show in 9.x in favor of display.root_group
do something like this instead

main_group = displayio.Group
display.root_group = main_group

@tannewt
Copy link
Member

tannewt commented Oct 23, 2023

We just discussed this in our internal meeting. We decided to add a show() function implementation that raises an exception when used to specify how to fix the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants