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

Function constructor

src/frameworks/tkinter/widgets/optionMenu.js:12–47  ·  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 this.state = {
20 ...this.state,
21 isDropDownOpen: false,
22 widgetName: "Option menu",
23 size: { width: 120, height: 30 },
24 fitContent: { width: true, height: true },
25 attrs: {
26 ...this.state.attrs,
27 defaultValue: {
28 label: "Default Value",
29 tool: Tools.INPUT,
30 value: "Select option",
31 onChange: (value) => {
32 this.setAttrValue("defaultValue", value)
33 }
34 },
35 widgetOptions: {
36 label: "Options",
37 tool: Tools.INPUT_RADIO_LIST,
38 value: {inputs: ["option 1"], selectedRadio: -1},
39 onChange: ({inputs, selectedRadio}) => {
40 this.setAttrValue("widgetOptions", {inputs, selectedRadio})
41 }
42 }
43
44 }
45 }
46
47 }
48
49 componentDidMount(){
50 super.componentDidMount()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected