minor bug fixes
This commit is contained in:
@@ -54,19 +54,19 @@ export class TkinterBase extends Widget {
|
||||
const expand = this.getAttrValue("flexManager.expand")
|
||||
|
||||
if (fillX){
|
||||
config['fill'] = "'x'"
|
||||
config['fill'] = `"x"`
|
||||
}
|
||||
|
||||
if (fillY){
|
||||
config['fill'] = "'y'"
|
||||
config['fill'] = `"y"`
|
||||
}
|
||||
|
||||
if (fillX && fillY){
|
||||
config['fill'] = "'both'"
|
||||
config['fill'] = `"both"`
|
||||
}
|
||||
|
||||
if (expand){
|
||||
config['expand'] = 'True'
|
||||
config['expand'] = "True"
|
||||
}
|
||||
|
||||
layoutManager = `pack(${convertObjectToKeyValueString(config)})`
|
||||
|
||||
@@ -58,9 +58,10 @@ class Label extends TkinterWidgetBase{
|
||||
|
||||
getRequirements(){
|
||||
const requirements = super.getRequirements()
|
||||
|
||||
|
||||
if (this.getAttrValue("imageUpload"))
|
||||
requirements.push(`pillow`)
|
||||
requirements.push("pillow")
|
||||
|
||||
return requirements
|
||||
}
|
||||
@@ -72,14 +73,15 @@ class Label extends TkinterWidgetBase{
|
||||
const config = convertObjectToKeyValueString(this.getConfigCode())
|
||||
const image = this.getAttrValue("imageUpload")
|
||||
|
||||
let labelInitialization = `tk.Label(master=${parent}, text="${labelText}")`
|
||||
let labelInitialization = `${variableName} = tk.Label(master=${parent}, text="${labelText}")`
|
||||
|
||||
const code = []
|
||||
|
||||
if (image.name){
|
||||
if (image?.name){
|
||||
code.push(`${variableName}_img = Image.open(${getPythonAssetPath(image.name, "image")})`)
|
||||
code.push(`${variableName}_img = ImageTk.PhotoImage(${variableName}_img)`)
|
||||
labelInitialization = `tk.Label(master=${parent}, image="${variableName}_img", text="${labelText}")`
|
||||
// code.push("\n")
|
||||
labelInitialization = `${variableName} = tk.Label(master=${parent}, image="${variableName}_img", text="${labelText}")`
|
||||
}
|
||||
|
||||
// code.push("\n")
|
||||
|
||||
@@ -42,7 +42,6 @@ class OptionMenu extends TkinterWidgetBase{
|
||||
}
|
||||
}
|
||||
|
||||
console.log("attrs1: ", this.state.attrs)
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
@@ -71,7 +70,7 @@ class OptionMenu extends TkinterWidgetBase{
|
||||
const toolBarAttrs = super.getToolbarAttrs()
|
||||
|
||||
const attrs = this.state.attrs
|
||||
console.log("attrs: ", attrs)
|
||||
|
||||
return ({
|
||||
id: this.__id,
|
||||
widgetName: toolBarAttrs.widgetName,
|
||||
|
||||
Reference in New Issue
Block a user