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

Method constructor

src/frameworks/tkinter/widgets/slider.js:13–92  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

11
12 // FIXME: You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use
13 constructor(props) {
14 super(props)
15
16 this.state = {
17 ...this.state,
18 widgetName: "Scale",
19 size: { width: 120, height: 10 },
20 fitContent: {width: true, height: true},
21 attrs: {
22 ...this.state.attrs,
23 styling: {
24 ...this.state.attrs.styling,
25 // TODO: trough color
26 troughColor: {
27 label: "Trough Color",
28 tool: Tools.COLOR_PICKER,
29 value: "#fff",
30 onChange: (value) => {
31 // this.setWidgetInnerStyle("color", value)
32 this.setAttrValue("styling.troughColor", value)
33 }
34 }
35 },
36 scale: {
37 label: "Scale",
38 display: "horizontal",
39 min: {
40 label: "Min",
41 tool: Tools.NUMBER_INPUT, // the tool to display, can be either HTML ELement or a constant string
42 toolProps: { placeholder: "min" },
43 value: 0,
44 onChange: (value) => this.setAttrValue("scale.min", value)
45 },
46 max: {
47 label: "Max",
48 tool: Tools.NUMBER_INPUT,
49 toolProps: { placeholder: "max"},
50 value: 100,
51 onChange: (value) => this.setAttrValue("scale.max", value)
52 },
53 step: {
54 label: "Step",
55 tool: Tools.NUMBER_INPUT,
56 toolProps: { placeholder: "max", stringMode: true, step: "0.1"},
57 value: 1,
58 onChange: (value) => this.setAttrValue("scale.step", value)
59 },
60 default: {
61 label: "Default",
62 tool: Tools.NUMBER_INPUT,
63 toolProps: { placeholder: "max", stringMode: true, step: "0.1"},
64 value: 0,
65 onChange: (value) => this.setAttrValue("scale.default", value)
66 }
67 },
68 orientation: {
69 label: "Orientation",
70 tool: Tools.SELECT_DROPDOWN,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected