Is there an event that fires when a widget is collapsed?

Is it possible to set up an event in a custom Userwidget that will fire when that widget (itself) is collapsed?

if the solution requires C++, that’s ok. I have most of my project in C++ except for the design of the widgets.

My situation is this: I have a character sheet where the player can spend stat points. The character must select “ok” after spending stat points to make the changes permanent. There is also a cancel button that unspends all the spent stat points.

I would like the “cancel” function to also run when the character sheet is closed.

There is an easier solution than detecting onCollapsed.

Your Cancel function is, most likely, hooked up to a button press event - something like onClick. While you cannot call this onClick directly in UMG, you can create a custom event and connect it to the same network of nodes. When you close the character sheet, call the custom event - this will simulate pressing the button.