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

Function constructor

src/frameworks/customtk/widgets/optionMenu.js:12–50  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

10 static displayName = "Option Menu"
11
12 constructor(props) {
13 super(props)
14
15 // const {layout, ...newAttrs} = this.state.attrs // Removes the layout attribute
16
17 this.minSize = {width: 50, height: 30}
18
19 let newAttrs = removeKeyFromObject("styling.borderColor", this.state.attrs)
20 newAttrs = removeKeyFromObject("styling.borderWidth", newAttrs)
21
22 this.state = {
23 ...this.state,
24 isDropDownOpen: false,
25 widgetName: "Option menu",
26 size: { width: 120, height: 30 },
27 fitContent: { width: true, height: true },
28 attrs: {
29 ...newAttrs,
30 defaultValue: {
31 label: "Default Value",
32 tool: Tools.INPUT,
33 value: "Select option",
34 onChange: (value) => {
35 this.setAttrValue("defaultValue", value)
36 }
37 },
38 widgetOptions: {
39 label: "Options",
40 tool: Tools.INPUT_RADIO_LIST,
41 value: {inputs: ["option 1"], selectedRadio: -1},
42 onChange: ({inputs, selectedRadio}) => {
43 this.setAttrValue("widgetOptions", {inputs, selectedRadio})
44 }
45 }
46
47 }
48 }
49
50 }
51
52 componentDidMount(){
53 super.componentDidMount()

Callers

nothing calls this directly

Calls 1

removeKeyFromObjectFunction · 0.90

Tested by

no test coverage detected