MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / button

Function button

src/python/lfs_plugins/rml_widgets.py:220–235  ·  view source on GitHub ↗

Create a styled button element. Args: style: One of "", "primary", "success", "warning", "error", "secondary".

(container, id, label, style="", disabled=False)

Source from the content-addressed store, hash-verified

218
219
220def button(container, id, label, style="", disabled=False):
221 """Create a styled button element.
222
223 Args:
224 style: One of "", "primary", "success", "warning", "error", "secondary".
225 """
226 btn = container.append_child("button")
227 btn.set_id(id)
228 classes = "btn"
229 if style:
230 classes += f" btn--{style}"
231 btn.set_class_names(classes)
232 btn.set_text(label)
233 if disabled:
234 btn.set_attribute("disabled", "disabled")
235 return btn
236
237
238def aligned_property_row(container, label="", control_classes="setting-row__control-col"):

Callers 3

button_callbackMethod · 0.85
prop_enumMethod · 0.85
operator_Method · 0.85

Calls 5

append_childMethod · 0.45
set_idMethod · 0.45
set_class_namesMethod · 0.45
set_textMethod · 0.45
set_attributeMethod · 0.45

Tested by

no test coverage detected