Skip to content

Feature request: Allow setting button labels on GenericDialog #525

@iverks

Description

@iverks

As of now the button labels on GenericDialog are hard coded as "Cancel" and "Ok". It would be very nice if it was possible to change them, e.g.

dialog = gui.GenericDialog(
    title="Red pill or blue pill", 
    message="This is your last chance. After this, there is no turning back. You take the blue pill - the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill - you stay in Wonderland and I show you how deep the rabbit hole goes.",
    cancel_label="Blue pill",
    confirm_label="Red pill",
)

EDIT: I found out that it is possilbe to hack using

dialog.conf.set_text("Red pill")
dialog.cancel.set_text("Blue pill")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions