def __init__(self, json_str, master=None):
    j = json.loads(json_str)
    self.name = j['name']
    self.description = j['description']
    self.flag = j['flags'][(len(j['flags']) - 1)]
    self.parameter_type = j['parameter_type']
    self.optional = j['optional']
    default_value = j['default_value']
    ttk.Frame.__init__(self, master)
    self.grid()
    self['padding'] = '0.02i'
    frame = ttk.Frame(self, padding='0.0i')
    self.label = ttk.Label(self, text=self.name, justify=tk.LEFT)
    self.label.grid(row=0, column=0, sticky=tk.W)
    self.label.columnconfigure(0, weight=1)
    frame2 = ttk.Frame(frame, padding='0.0i')
    opt = ttk.Combobox(frame2, width=40)
    opt.grid(row=0, column=0, sticky=tk.NSEW)
    self.value = None
    i = 1
    default_index = (- 1)
    list = j['parameter_type']['OptionList']
    values = ()
    for v in list:
        values += (v,)
        if (v == default_value):
            default_index = (i - 1)
        i = (i + 1)
    opt['values'] = values
    opt.bind('<<ComboboxSelected>>', self.select)
    if (default_index >= 0):
        opt.current(default_index)
        opt.event_generate('<<ComboboxSelected>>')
    frame2.grid(row=0, column=0, sticky=tk.W)
    frame.grid(row=1, column=0, sticky=tk.W)
    frame.columnconfigure(0, weight=1)
    self.columnconfigure(0, weight=1)
    self.rowconfigure(0, weight=1)
def __init__(self, json_str, master=None):
    j = json.loads(json_str)
    self.name = j['name']
    self.description = j['description']
    self.flag = j['flags'][(len(j['flags']) - 1)]
    self.parameter_type = j['parameter_type']
    self.optional = j['optional']
    default_value = j['default_value']
    ttk.Frame.__init__(self, master)
    self.grid()
    self['padding'] = '0.02i'
    frame = ttk.Frame(self, padding='0.0i')
    self.label = ttk.Label(self, text=self.name, justify=tk.LEFT)
    self.label.grid(row=0, column=0, sticky=tk.W)
    self.label.columnconfigure(0, weight=1)
    frame2 = ttk.Frame(frame, padding='0.0i')
    opt = ttk.Combobox(frame2, width=40)
    opt.grid(row=0, column=0, sticky=tk.NSEW)
    self.value = None
    i = 1
    default_index = (- 1)
    list = j['parameter_type']['OptionList']
    values = ()
    for v in list:
        values += (v,)
        if (v == default_value):
            default_index = (i - 1)
        i = (i + 1)
    opt['values'] = values
    opt.bind('<<ComboboxSelected>>', self.select)
    if (default_index >= 0):
        opt.current(default_index)
        opt.event_generate('<<ComboboxSelected>>')
    frame2.grid(row=0, column=0, sticky=tk.W)
    frame.grid(row=1, column=0, sticky=tk.W)
    frame.columnconfigure(0, weight=1)
    self.columnconfigure(0, weight=1)
    self.rowconfigure(0, weight=1)