Why aren't we using "Active Widget Index"?

I’m baffled why we’re not just changing ActiveWidgetIndex to switch between menus. Can someone explain why? When that paramter was introduced in video 13_MS_UEM, I imagined we would change that number with enums.

1 Like

Hi,
I think the parameter doesn’t get used. I see no reference at all at the end of the section.

Correct, I’m just asking why.

Hi,

Truthfully I have no idea why it wasn’t used and it is possible it didn’t exist when the course was created.

This actually seems likely as to why it was done as I just checked an older version of the engine and the property isn’t present but there is a set method.

EDIT:
I recall why you wouldn’t use the index anyway. If you change the order in the widget switcher and rely on the index then the Active Widget Index would change as a result. This would then result in having to update your code. This is not a great thing to do and also not good practice. Using defined constants helps somewhat but you still have to update them too.

Considering a designer may be dealing with the menus, you best implement a technique that doesn’t rely on hard-coded indexes that they may break.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms