(variableName, parent)
| 97 | } |
| 98 | |
| 99 | generateCode(variableName, parent){ |
| 100 | // TODO: add orientation |
| 101 | |
| 102 | const config = this.getConfigCode() |
| 103 | |
| 104 | config["from_"] = this.getAttrValue("scale.min") |
| 105 | config["to"] = this.getAttrValue("scale.max") |
| 106 | config["resolution"] = this.getAttrValue("scale.step") |
| 107 | |
| 108 | if (this.getAttrValue("orientation")){ |
| 109 | config["orientation"] = this.getAttrValue("orientation") |
| 110 | } |
| 111 | |
| 112 | const defaultValue = this.getAttrValue("scale.default") |
| 113 | |
| 114 | return [ |
| 115 | `${variableName}_var = tk.DoubleVar(value=${defaultValue})`, |
| 116 | `${variableName} = tk.Scale(master=${parent}, variable=${variableName}_var)`, |
| 117 | `${variableName}.config(${convertObjectToKeyValueString(config)})`, |
| 118 | `${variableName}.${this.getLayoutCode()}` |
| 119 | ] |
| 120 | } |
| 121 | |
| 122 | getToolbarAttrs(){ |
| 123 |
nothing calls this directly
no test coverage detected