working on code generation

This commit is contained in:
paul
2024-09-26 11:59:24 +05:30
parent 37e7bea0fa
commit e34751c20c
13 changed files with 252 additions and 108 deletions

View File

@@ -2,6 +2,7 @@ import Widget from "../../../canvas/widgets/base"
import Tools from "../../../canvas/constants/tools"
import { removeKeyFromObject } from "../../../utils/common"
import TkinterBase from "./base"
import { Layouts } from "../../../canvas/constants/layouts"
class Label extends TkinterBase{
@@ -45,6 +46,16 @@ class Label extends TkinterBase{
}
}
generateCode(parent){
const label = this.getAttrValue("labelWidget")
return (`
${this.getWidgetName()} = tk.Label(master=${parent}, text="${label}")
${this.getWidgetName()}.${this.getLayoutCode()}
`)
}
componentDidMount(){
super.componentDidMount()
this.setAttrValue("styling.backgroundColor", "#fff0")