working on code generation
This commit is contained in:
@@ -8,6 +8,7 @@ import TkinterBase from "./base"
|
||||
class SpinBox extends TkinterBase{
|
||||
|
||||
static widgetType = "spin_box"
|
||||
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
@@ -75,6 +76,23 @@ class SpinBox extends TkinterBase{
|
||||
this.setWidgetName("SpinBox")
|
||||
}
|
||||
|
||||
generateCode(variableName, parent){
|
||||
|
||||
const min = this.getAttrValue("spinProps.min")
|
||||
const max = this.getAttrValue("spinProps.max")
|
||||
const step = this.getAttrValue("spinProps.step")
|
||||
const defaultValue = this.getAttrValue("spinProps.defaultValue")
|
||||
|
||||
const bg = this.getAttrValue("styling.backgroundColor")
|
||||
const fg = this.getAttrValue("styling.foregroundColor")
|
||||
return [
|
||||
`${variableName} = tk.Spinbox(master=${parent})`,
|
||||
`${variableName}.config(bg="${bg}", fg="${fg}", from_=${min}, to=${max},
|
||||
increment=${step})`,
|
||||
`${variableName}.${this.getLayoutCode()}`
|
||||
]
|
||||
}
|
||||
|
||||
getToolbarAttrs(){
|
||||
|
||||
const toolBarAttrs = super.getToolbarAttrs()
|
||||
|
||||
Reference in New Issue
Block a user