How to get a widget from a button placed in a slot [UE4.26]

get a ref???
when u check is variable, u can take a ref…of button.
i don’t know what is your problem.

1 Like

First of all, sorry for my poor English…

Within the button object, I want to access the widget it belongs to.

ex) ‘B Button’ placed on ‘A UserWidget’

I want to reference ‘A UserWidget’ object from ‘B Button object’.

that widget call self.
just search self, u will get that.
hope i understand correctly.
But, if the button is a custom widget.
u can try to get parent inside button widget.

u can try to get parent inside button widget.

It would return the immediate parent container, not the parent user widget. Will not work the way you think in 99% cases.

  • widget A has widget B inside
  • B wants to talk to A

Do you want B to just talk to A or do you really need B to have a hard reference to A? Asking, as communication can be done in many ways. Both can be done.