Skip to content

Missing error message when no option is selected #2

@gptgit

Description

@gptgit

In the Password_Generator_v1.1.0.py file, when the "Generate" button is clicked without selecting any options (Ascii, Punctuation, Digits), there is no error message displayed to notify the user about the requirement of selecting at least one option.

Steps to Reproduce:

  1. Run the Password_Generator_v1.1.0.py file.
  2. Leave all the checkboxes (Ascii, Punctuation, Digits) unchecked.
  3. Click on the "Generate" button.

Expected Behavior:
An error message should be displayed, informing the user that at least one option needs to be selected.

Actual Behavior:
No error message is shown, and the program continues without generating a password.

Proposed Solution:
To improve the user experience and provide clear feedback, it is recommended to add an error message when no option is selected. This can be achieved using the tkinter.messagebox module to display a messagebox with an appropriate error message.

import tkinter.messagebox as messagebox

# Inside the generate_func() function
if check1var.get() == 0 and check2var.get() == 0 and check3var.get() == 0:
    messagebox.showinfo("Error", "Please select at least one option!")

By adding this code snippet, an error messagebox will be displayed when the user tries to generate a password without selecting any option. The message will prompt the user to select at least one option before generating the password.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions