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