(props)
| 10 | static displayName = "Label" |
| 11 | |
| 12 | constructor(props) { |
| 13 | super(props) |
| 14 | |
| 15 | // border color and width is not available for label in customtkinter |
| 16 | let newAttrs = removeKeyFromObject("styling.borderColor", this.state.attrs) |
| 17 | newAttrs = removeKeyFromObject("styling.borderWidth", newAttrs) |
| 18 | |
| 19 | |
| 20 | this.state = { |
| 21 | ...this.state, |
| 22 | widgetName: "Label", |
| 23 | size: { width: 80, height: 40 }, |
| 24 | attrs: { |
| 25 | ...newAttrs, |
| 26 | labelWidget: { |
| 27 | label: "Text", |
| 28 | tool: Tools.INPUT, |
| 29 | toolProps: {placeholder: "text", maxLength: 100}, |
| 30 | value: "Label", |
| 31 | onChange: (value) => this.setAttrValue("labelWidget", value) |
| 32 | }, |
| 33 | imageUpload: { |
| 34 | label: "Image", |
| 35 | tool: Tools.UPLOADED_LIST, |
| 36 | toolProps: {filterOptions: ["image/jpg", "image/jpeg", "image/png"]}, |
| 37 | value: "", |
| 38 | onChange: (value) => this.setAttrValue("imageUpload", value) |
| 39 | }, |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | } |
| 44 | |
| 45 | componentDidMount(){ |
| 46 | super.componentDidMount() |
nothing calls this directly
no test coverage detected