'TkInter messagebox bug Warning: Expected min height of view ?? (macOS)
To start here is some background information: Python Version 3.9.10 64bit TkInter v8.6 macOS Monterey 12.3.1 Running from VS Code
In short I am trying to learn the TkInter module. Everything works well except when I try to use messagebox. It throws an error and so far I haven't found anything to help me out. I have tried uninstalling and reinstalling a tkinter and macvim with no success. Please let me know what you guys find! (Error appears when initially running code and when initiate by the button)
Error Code: (base) rutemauro@Caios-Mac-Book cps121 % cd /Users/rutemauro/Desktop/cps121 ; /usr/bin/env /usr/local/bin/python3 /Users/rut emauro/.vscode/extensions/ms-python.python-2022.4.1/pythonFiles/lib/python/debugpy/launcher 54603 -- /Users/rutemauro/Desktop /cps121/python-practice/TkInter-GUI/loginTemplate.py 2022-04-20 01:05:35.263 Python[2534:43780] Warning: Expected min height of view: (<NSButton: 0x7fc31191aab0>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation. 2022-04-20 01:05:36.342 Python[2534:43780] Warning: Expected min height of view: (<NSButton: 0x7fc311a59fe0>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
Its a simple login form so here is the code that matters:
#Login Function
def loginFunc():
if usernameEntry.get() == 0:
messagebox.showerror("login unsuccessful", "Please Enter a Password")
elif passwordEntry.get() == 0:
messagebox.showerror("login unsuccessful", "Please Enter a Password")
else:
messagebox.showinfo("login successful", "You have successfully been logged in")
#Login Button
loginButton = Button(root, text="Login", font=("Arial",16), command=loginFunc)
loginButton.pack(pady=20)
github to full code (i think): https://gist.github.com/caiomauro/1abc39c5f2826d18e78555ec776df6b4
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
