working on code generation
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user