diff --git a/src/frameworks/tkinter/widgets/base.js b/src/frameworks/tkinter/widgets/base.js index 8b9cf5f..ac7804e 100644 --- a/src/frameworks/tkinter/widgets/base.js +++ b/src/frameworks/tkinter/widgets/base.js @@ -12,8 +12,6 @@ import { ANCHOR, GRID_STICKY, JUSTIFY, RELIEF } from "../constants/styling" // FIXME: grid sticky may clash with flex sticky when changing layout, check it once -// FIXME: widget items should add width and height in tkinter code especially in frame -// TODO: width and height aren't really fixed export class TkinterBase extends Widget { static requiredImports = ['import tkinter as tk'] @@ -693,7 +691,7 @@ export class TkinterBase extends Widget { if (layout === Layouts.GRID){ - const {positioning, ...restAttrs} = this.state.attrs + const {...restAttrs} = this.state.attrs const updates = { attrs: { @@ -811,6 +809,12 @@ export class TkinterBase extends Widget { } this.updateState((prevState) => ({...prevState, ...updates})) + }else if (layout === Layouts.FLEX){ + const {gridConfig, gridWeights, ...restAttrs} = this.state.attrs + + console.log("Flex: ", restAttrs) + + this.updateState((prevState) => ({attrs: {...restAttrs}})) } this.props.onLayoutUpdate({parentId: this.__id, parentLayout: value})// inform children about the layout update @@ -1215,7 +1219,7 @@ export class TkinterWidgetBase extends TkinterBase{ config["pady"] = this.getAttrValue("margin.marginY") } - // FIXME: add width and height, the scales may not be correct as the width and height are based on characters in pack and grid not pixels + // FIXME: add width and height, the scales may not be correct as the width and height are based on characters in label and grid not pixels // if (!this.state.fitContent.width){ // config["width"] = this.state.size.width // } diff --git a/src/frameworks/tkinter/widgets/mainWindow.js b/src/frameworks/tkinter/widgets/mainWindow.js index 83f58b7..0535f9f 100644 --- a/src/frameworks/tkinter/widgets/mainWindow.js +++ b/src/frameworks/tkinter/widgets/mainWindow.js @@ -111,8 +111,8 @@ class MainWindow extends TkinterBase{ id: this.__id, widgetName: toolBarAttrs.widgetName, title: this.state.attrs.title, + logo: this.state.attrs.logo, size: toolBarAttrs.size, - ...this.state.attrs, }) diff --git a/src/frameworks/tkinter/widgets/toplevel.js b/src/frameworks/tkinter/widgets/toplevel.js index c091a6a..4465029 100644 --- a/src/frameworks/tkinter/widgets/toplevel.js +++ b/src/frameworks/tkinter/widgets/toplevel.js @@ -104,8 +104,8 @@ class TopLevel extends TkinterBase{ return ({ widgetName: toolBarAttrs.widgetName, title: this.state.attrs.title, + logo: this.state.attrs.logo, size: toolBarAttrs.size, - ...this.state.attrs, })