(variableName, parent)
| 52 | } |
| 53 | |
| 54 | generateCode(variableName, parent){ |
| 55 | |
| 56 | |
| 57 | const config = convertObjectToKeyValueString(this.getConfigCode()) |
| 58 | |
| 59 | const defaultValue = this.getAttrValue("defaultValue") |
| 60 | const options = this.getAttrValue("widgetOptions").inputs |
| 61 | |
| 62 | const code = [ |
| 63 | `${variableName}_options = ${JSON.stringify(options)}`, |
| 64 | `${variableName}_var = tk.StringVar(value="${options.at(1) || defaultValue || ''}")`, |
| 65 | `${variableName} = tk.OptionMenu(${parent}, ${variableName}_var, *${variableName}_options)` |
| 66 | ] |
| 67 | |
| 68 | |
| 69 | return [ |
| 70 | ...code, |
| 71 | `${variableName}.config(${config})`, |
| 72 | `${variableName}.${this.getLayoutCode()}` |
| 73 | ] |
| 74 | } |
| 75 | |
| 76 | getToolbarAttrs(){ |
| 77 |
nothing calls this directly
no test coverage detected