MCPcopy Create free account
hub / github.com/DFHack/dfhack / getWidget

Method getWidget

library/modules/Gui.cpp:2652–2659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2650}
2651
2652df::widget * Gui::getWidget(df::widget_container *container, string name) {
2653 CHECK_NULL_POINTER(container);
2654 // ensure the compiler catches the change if we ever fix the template parameters
2655 auto & children_by_name = container->children_by_name;
2656 if (children_by_name.contains(name))
2657 return (children_by_name)[name].get();
2658 return NULL;
2659}
2660
2661df::widget * Gui::getWidget(df::widget_container *container, size_t idx) {
2662 CHECK_NULL_POINTER(container);

Callers

nothing calls this directly

Calls 3

containsMethod · 0.80
getMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected