MCPcopy Create free account
hub / github.com/PaulleDemon/PyUIBuilder / generateCode

Method generateCode

src/frameworks/customtk/widgets/slider.js:102–125  ·  view source on GitHub ↗
(variableName, parent)

Source from the content-addressed store, hash-verified

100 }
101
102 generateCode(variableName, parent){
103 // TODO: add orientation
104
105 const config = this.getConfigCode()
106
107 config["from_"] = this.getAttrValue("scale.min")
108 config["to"] = this.getAttrValue("scale.max")
109 config["number_of_steps"] = this.getAttrValue("scale.step")
110
111 config["progress_color"] = `"${this.getAttrValue("styling.progressColor")}"`
112
113 if (this.getAttrValue("orientation")){
114 config["orientation"] = this.getAttrValue("orientation")
115 }
116
117 const defaultValue = this.getAttrValue("scale.default")
118
119 return [
120 `${variableName}_var = ctk.DoubleVar(value=${defaultValue})`,
121 `${variableName} = ctk.CTkSlider(master=${parent}, variable=${variableName}_var)`,
122 `${variableName}.configure(${convertObjectToKeyValueString(config)})`,
123 `${variableName}.${this.getLayoutCode()}`
124 ]
125 }
126
127 getToolbarAttrs(){
128

Callers

nothing calls this directly

Calls 2

getConfigCodeMethod · 0.45

Tested by

no test coverage detected