MCPcopy Create free account
hub / github.com/PaulleDemon/PyUIBuilder / constructor

Function constructor

src/frameworks/tkinter/widgets/base.js:19–52  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

17 static requiredImports = ['import tkinter as tk']
18
19 constructor(props) {
20 super(props)
21
22 this.getLayoutCode = this.getLayoutCode.bind(this)
23
24 this.state = {
25 ...this.state,
26 packAttrs: { // This is required as during flex layout change remount happens and the state updates my not function as expected
27 side: "top",
28 anchor: "n",
29 }
30 }
31
32 this.renderTkinterLayout = this.renderTkinterLayout.bind(this) // this must be called if droppableTags is not set to null
33
34 const originalRenderContent = this.renderContent.bind(this);
35 this.renderContent = () => {
36 this._calledRenderTkinterLayout = false
37
38 const content = originalRenderContent()
39
40 if (
41 this.droppableTags !== null &&
42 this.droppableTags !== undefined &&
43 !this._calledRenderTkinterLayout
44 ) {
45 throw new Error(
46 `class ${this.constructor.name}: renderTkinterLayout() must be called inside renderContent() when droppableTags is not null`
47 )
48 }
49
50 return content
51 }
52 }
53
54
55 getLayoutCode(){

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected