(variableName, parent)
| 62 | } |
| 63 | |
| 64 | generateCode(variableName, parent){ |
| 65 | |
| 66 | const min = this.getAttrValue("spinProps.min") |
| 67 | const max = this.getAttrValue("spinProps.max") |
| 68 | const step = this.getAttrValue("spinProps.step") |
| 69 | const defaultValue = this.getAttrValue("spinProps.default") |
| 70 | |
| 71 | const config = { |
| 72 | from_: min, |
| 73 | to: max, |
| 74 | increment: step, |
| 75 | value: defaultValue, |
| 76 | ...this.getConfigCode() |
| 77 | } |
| 78 | |
| 79 | const code = [] |
| 80 | let spinBox = `${variableName} = tk.Spinbox(master=${parent})` |
| 81 | if (defaultValue){ |
| 82 | code.push(`${variableName}_var = tk.IntVar(${defaultValue})`) |
| 83 | spinBox = `${variableName} = tk.Spinbox(master=${parent}, textvariable=${variableName}_var)` |
| 84 | } |
| 85 | code.push(spinBox) |
| 86 | |
| 87 | return [ |
| 88 | ...code, |
| 89 | `${variableName}.config(${convertObjectToKeyValueString(config)})`, |
| 90 | `${variableName}.${this.getLayoutCode()}` |
| 91 | ] |
| 92 | } |
| 93 | |
| 94 | getToolbarAttrs(){ |
| 95 |
nothing calls this directly
no test coverage detected