Announcement

Collapse
No announcement yet.

Widget can't modify child

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

    Widget can't modify child

    Hi

    I created a Widget "W_Filter" composed of an check box and an text block.

    I added severals times this widget class into another widget (check screen), and I tried to modify the text block of each child, but i could'nt/ didn't find how to do it...

    Help

    #2


    Use Get Child At function and Cast Actual Widget.


    WBP_CheckBoxs


    Click image for larger version  Name:	3.png Views:	0 Size:	28.1 KB ID:	1686356

    Click image for larger version  Name:	4.png Views:	0 Size:	118.3 KB ID:	1686358


    WBP_CheckBoxItem

    Click image for larger version  Name:	image_176971.png Views:	4 Size:	15.3 KB ID:	1686347

    Click image for larger version  Name:	image_176972.png Views:	4 Size:	46.6 KB ID:	1686348

    Last edited by empty2fill; 11-13-2019, 01:42 AM.

    Comment


      #3
      There's no need for the above at all.

      Create a text variable in the child, flag it as Instance Editable bind it to the text box (or set the Text Box' text in the Construction Script). It will now be easily editable by the widget owner.

      Child:

      Click image for larger version

Name:	Annotation-20191113-072517.png
Views:	78
Size:	61.7 KB
ID:	1686387

      Parent:

      Click image for larger version

Name:	Annotation-20191113-072538.png
Views:	58
Size:	20.7 KB
ID:	1686388

      Comment


        #4
        Thanks guys for yours answers !
        Originally posted by Everynone View Post
        There's no need for the above at all.

        Create a text variable in the child, flag it as Instance Editable bind it to the text box (or set the Text Box' text in the Construction Script). It will now be easily editable by the widget owner.

        Child:

        Click image for larger version

Name:	Annotation-20191113-072517.png
Views:	78
Size:	61.7 KB
ID:	1686387

        Parent:

        Click image for larger version

Name:	Annotation-20191113-072538.png
Views:	58
Size:	20.7 KB
ID:	1686388

        I used your solution, thanks man !

        One more question, what's the difference between pre-construct and construct ?

        Comment


          #5
          Pre-Construct allows you to see the changes straight in the designer and experiment without the need to run the project.

          Or to word it better:

          Click image for larger version  Name:	Annotation-20191113-122108.png Views:	0 Size:	25.9 KB ID:	1686480

          As an example, if I used just Construct in my original example, my designer would look like so:

          Click image for larger version  Name:	Annotation-20191113-122436.png Views:	0 Size:	21.2 KB ID:	1686482

          Notice the mismatch between the desired button text and what the button shows. The button text is not going to update until I actually run the game and the widget's Construction Script applies the changes. Pre-Construct allows for an instant preview, though.
          Last edited by Everynone; 11-13-2019, 08:45 AM.

          Comment


            #6
            I see ! Thanks man for you help, i appreciate this !

            Comment

            Working...
            X