MCPcopy Create free account
hub / github.com/esengine/esengine / setItemCheckable

Method setItemCheckable

packages/fairygui/src/widgets/PopupMenu.ts:182–196  ·  view source on GitHub ↗

* Set item checkable state by name * 通过名称设置菜单项可选中状态

(name: string, bCheckable: boolean)

Source from the content-addressed store, hash-verified

180 * 通过名称设置菜单项可选中状态
181 */
182 public setItemCheckable(name: string, bCheckable: boolean): void {
183 const item = this._list.getChild(name);
184 if (item && item instanceof GButton) {
185 const c = item.getController('checked');
186 if (c) {
187 if (bCheckable) {
188 if (c.selectedIndex === 0) {
189 c.selectedIndex = 1;
190 }
191 } else {
192 c.selectedIndex = 0;
193 }
194 }
195 }
196 }
197
198 /**
199 * Set item checked state by name

Callers

nothing calls this directly

Calls 2

getChildMethod · 0.45
getControllerMethod · 0.45

Tested by

no test coverage detected