# My widget\_message is not working.

**URL:** <https://forums.unrealengine.com/t/my-widget-message-is-not-working/1253244>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, Widget, question, fortnite\
**Created:** [August 7, 2023, 7:14am UTC](https://forums.unrealengine.com/t/my-widget-message-is-not-working/1253244 "2023-08-07T07:14:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lMedievall](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lMedievall](https://forums.unrealengine.com/u/lMedievall)\
**Post date:** [August 7, 2023, 7:14am UTC](https://forums.unrealengine.com/t/my-widget-message-is-not-working/1253244/1 "2023-08-07T07:14:23Z")

</div>

Hi,

I’m trying to use the widget\_message struct but its not working like it does in the tutorial. When I try to print the Message.Source like in the tutorial, its blank. My code is below and tutorial code is below that.

```auto
HandleSelectedUIButtonExit(Message: widget_message) : void = 
        if (PlayerUI := GetPlayerUI[Message.Player], MyUI := MaybeMyUIPerPlayer[Message.Player]?, SelectedButton := text_button_base[Message.Source]):
            Print("Player selected {SelectedButton.GetText()}")
            PlayerUI.RemoveWidget(MyUI)
            if (set MaybeMyUIPerPlayer[Message.Player] = false) {}

```

```auto
HandleSelectedUIButton(Message : widget_message) : void =
         if (PlayerUI := GetPlayerUI[Message.Player], MyUI := MaybeMyUIPerPlayer[Message.Player]?, SelectedButton := text_button_base[Message.Source]):
             Print("Player selected {SelectedButton.GetText()}")
             PlayerUI.RemoveWidget(MyUI)
             if (set MaybeMyUIPerPlayer[Message.Player] = false) {}

```

But when I press the button in game, its blank( image below).  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/f/a/cfa6af036db926ffae8140c2328e0063906ccbec.jpeg)

The tutorial shows this.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/1/3/913eebbc409d90934c86d554d6c23b110cae40b6.jpeg)

I’m using a signal\_remote\_device to initiate the widget but I wouldn’t think that difference is causing this.

---

<div class="post-metadata">

**Author:** ![kmahl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kmahl](https://forums.unrealengine.com/u/kmahl)\
**Post date:** [August 20, 2023, 1:14pm UTC](https://forums.unrealengine.com/t/my-widget-message-is-not-working/1253244/2 "2023-08-20T13:14:47Z")

</div>

same problem here!

---

<div class="post-metadata">

**Author:** ![kmahl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kmahl](https://forums.unrealengine.com/u/kmahl)\
**Post date:** [August 21, 2023, 1:47pm UTC](https://forums.unrealengine.com/t/my-widget-message-is-not-working/1253244/3 "2023-08-21T13:47:54Z")

</div>

I managed to get the value to be printed by declaring the button and the text at the start and assigning 2 different texts

```auto
    # Two text
    TextDefault<localizes> : message = "Button1"
    AlternativeText<localizes> : message = "Button1"
    # Button to assign
    var Button1: button_loud = button_loud{}

   OnBegin<override>()<suspends>:void=
         # define on Begin
         set Button1= button_loud{DefaultText := TextDefault}
    
    # And creating the UI
    CreateMyUI() : canvas =        
        Button1.SetText(AlternativeText)
        Button1.OnClick().Subscribe(HandleSelectedUIButton)

```

---

<div class="post-metadata">

**Author:** ![lMedievall](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lMedievall](https://forums.unrealengine.com/u/lMedievall)\
**Post date:** [August 22, 2023, 1:12am UTC](https://forums.unrealengine.com/t/my-widget-message-is-not-working/1253244/4 "2023-08-22T01:12:39Z")

</div>

I tried this and it worked! Thanks for the help!

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [September 21, 2023, 1:13am UTC](https://forums.unrealengine.com/t/my-widget-message-is-not-working/1253244/5 "2023-09-21T01:13:30Z")

</div>

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