Announcement

Collapse
No announcement yet.

Add a custom object pointer in UWidget to store temporary data

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [FEATURE REQUEST] Add a custom object pointer in UWidget to store temporary data

    e.g. in my UMG, there's ScrollBox contains message list, and I need to store MsgID in very UButton Widget(a UButton represents a message), because I want to get MsgID from UButton Widget Object in callback function of UButton.

    #2
    I appreciate the feedback but I don't think I'll be adding this. In order for you to store MsgID, MsgID would need to be a UObject. You should instead make the buttons in the list a common UserWidget with members holding the information you care about, with the ability to handle being clicked internally rather than trying to just hang data onto primitive controls. That would encapsulate the responsibility and data for each item.

    Comment


      #3
      Originally posted by Nick Darnell View Post
      I appreciate the feedback but I don't think I'll be adding this. In order for you to store MsgID, MsgID would need to be a UObject. You should instead make the buttons in the list a common UserWidget with members holding the information you care about, with the ability to handle being clicked internally rather than trying to just hang data onto primitive controls. That would encapsulate the responsibility and data for each item.
      OK, I see. Your suggestion is better, thx very much~

      Comment

      Working...
      X