Working with tkinter can be tricky. I built a library called easy_gui to wrap tkinter and simplify this sort of project; you might find it handy here.
Check out the below code for an example that sets up most of the functionality you describe. To actually "create an order form", you'll probably need a lot more going on in the create_order function.
Each of the buttons in the main window needs a command_func function that gets triggered when clicked. I recommend adding methods to the GUI class like extractors_cleaners to handle each of the buttons separately.
Within the extractors_cleaners method, creating a new window is completely handled by the with self.popup() as popup: line. Just add widgets to popup as needed to manipulate the new window. The code gets a little dense, but the "Create Order" button in the popup window calls the create_order function and passes in text that we generate from within the new window.
import easy_gui
def create_order(text):
with open('order_form.txt', 'w') as f:
f.write(text)
class GUI(easy_gui.EasyGUI):
def __init__(self):
self.title('Order Forms') # set title of GUI window
self.add_widget('button', 'Extractors/Cleaners', command_func=self.extractors_cleaners)
self.add_widget('button', 'Air Movers/Fans', command_func=self.air_movers)
self.add_widget('button', 'Dehumidifiers', command_func=self.dehumidifiers)
self.add_widget('button', 'Air Filtration', command_func=lambda *args: print('...'))
self.add_widget('button', 'Generators', command_func=lambda *args: print('...'))
def extractors_cleaners(self, *args): # gets called when associated button is clicked
with self.popup() as popup: # generate a popup window
popup.geometry('500x600') # size of popup window
popup.add_widget('label', 'Extractors/Cleaners Order Form', underline=True, bold=True)
popup.add_widget('label', 'Order Details...\nMore Details...')
text = popup.add_widget('scrolledtext')
checkbox = popup.add_widget('checkbox', 'Fast Order?')
def order_text(): # read status of 'text' and 'checkbox' widgets and return a string
return '---FAST ORDER---\n' + '\n'.join(text.get()) if checkbox.get() else '\n'.join(text.get())
popup.add_widget('button', 'Create Order', command_func=lambda *args: create_order(order_text()))
def air_movers(self, *args):
...
def dehumidifiers(self, *args):
...
GUI()
Unfortunately there's not much documentation for easy_gui currently, but there are a few more examples here:
https://github.com/zachbateman/easy_gui