(props)
| 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(){ |
nothing calls this directly
no outgoing calls
no test coverage detected