Skip to content

Some weird "set color mode" issue #106

@sirquackiii

Description

@sirquackiii

I know this question has been asked before, but the fix for it didn't apply to my code. The code is very simple, and I don't know what's happening.

What's supposed to happen is then when the button is pressed, it runs the hello() function, which adds a label to the screen saying You Pressed me!. But, an error pops up saying AttributeError: 'NoneType' object has no attribute 'set_color_mode'.

Here is my code:

import py_cui

root = py_cui.PyCUI(14, 18)

def hello():
    root.add_label("You Pressed me!", 0, 0)

button = root.add_button('Button Text', 1, 2, column_span=2, command=hello())
root.start()

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingGood first issueGood for newcomersRendererIssue has to do with Renderer

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions