I need the user to enter an integer number into my program. They shouldn't be able to enter strings/floats. If the user hasn't entered an integer and clicks the button I would like an error message to pop up similar to the one you get if your username/password is incorrect when logging into something.
from tkinter import *
class GUI:
def __init__(self, parent):
self.iv = IntVar()
self.sb = Spinbox(parent, from_=0, to=10, textvariable = self.iv)
self.sb.pack()
self.b1 = Button(parent, text="Confirm")
self.b1.pack()
root = Tk()
root.geometry("800x600")
GUI = GUI(root)
root.title("Example")
root.mainloop()