minor bug fixes

This commit is contained in:
paul
2024-09-29 20:57:10 +05:30
parent 97fca285d7
commit 923e371f1f
4 changed files with 20 additions and 17 deletions

View File

@@ -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)})`

View File

@@ -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")

View File

@@ -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,