title: How do I create a popup window in tkinter?
body: <p>I have a problem creating a popup window for a program.</p>
  
  <p>Code:</p>
  
  <pre><code>from tkinter import *
  from tkinter import ttk
  import tkinter as tk
  
  def popupBonus():
      popupBonusWindow = tk.Tk()
      popupBonusWindow.wm_title("Window")
      labelBonus = Label(popupBonusWindow, text="Input")
      labelBonus.grid(row=0, column=0)
      B1 = ttk.Button(popupBonusWindow, text="Okay", command=popupBonusWindow.destroy())
      B1.pack()
  
  class Application(ttk.Frame):
      def __init__(self, master):
          ttk.Frame.__init__(self, master)
          mainwindow = ttk.Frame(self)
  
          self.buttonBonus = ttk.Button(self, text="Bonuses", command=popupBonus)
          self.buttonBonus.pack()
  </code></pre>
  
  <p>The code generates a window with a button and when you press the button, it's supposed to generate a popup window with title "Window", text "Input", and have a button saying "Okay" to exit popup window and return to main window. However, I am getting this error.</p>
  
  <pre><code> Traceback (most recent call last):
    File "D:\Softwares\Python 3.6.0\lib\tkinter\__init__.py", line 1699, in __call__
  return self.func(*args)
    File "C:\Users\J---- M--\Desktop\Python\GUI-Messagebox 5.py", line 12, in popupBonus
  B1 = ttk.Button(popupBonusWindow, text="Okay", command=popupBonusWindow.destroy())
    File "D:\Softwares\Python 3.6.0\lib\tkinter\ttk.py", line 614, in __init__
  Widget.__init__(self, master, "ttk::button", kw)
    File "D:\Softwares\Python 3.6.0\lib\tkinter\ttk.py", line 559, in __init__
  tkinter.Widget.__init__(self, master, widgetname, kw=kw)
    File "D:\Softwares\Python 3.6.0\lib\tkinter\__init__.py", line 2293, in __init__
  (widgetName, self._w) + extra + self._options(cnf))
  _tkinter.TclError: NULL main window
  </code></pre>
  
  <p>I have no idea what the problem is. I have trying to find answer for 4 hours and basically gave up.</p>
  
  <p>Also, I don't want to use tkinter's messagebox feature because I don't want the exclamation mark image and I want to include multiple checkboxs inside the popup window later on.</p>