from Tkinter import * import Tkinter as ttk from ttk import * root = Tk() root.title("puppet app") # Add a grid mainframe = Frame(root) mainframe.grid(column=0,row=0, sticky=(N,W,E,S) ) mainframe.columnconfigure(0, weight = 1) mainframe.rowconfigure(0, weight = 1) mainframe.pack(pady = 100, padx = 100) tkvar = StringVar(root) choices = { 'Package','file'} tkvar.set('Package') # set the default option popupMenu = OptionMenu(mainframe, tkvar, *choices) Label(mainframe, text="Choose an option").grid(row = 1, column = 1) popupMenu.grid(row = 2, column =1) def change_dropdown(*args): print( tkvar.get() ) tkvar.trace('w', change_dropdown) root.mainloop()So, when someone selects "package", i need another drop down box to appear or another box to have its options change to the package specific attributes.
This is a puppet manifest in its normal form:
package { 'apache2': require => Exec['apt-update'], # require 'apt-update' before installing ensure => installed, }So the "require" attribute for package, isnt necessary for the 'file' option.
So at the minute, its almost nothing. just a small GUI box, with one drop down.
I'm thinking the options may change using an IF statement? but i'm not sure how to do it.
Any help appreciated.