Bindings text to variable from parent widget (modular widget)

Hello I have an issue with widget components (I don’t know if my request is doable).

Here is my issue, I want to make a modular widget. But I don’t know how to make binding for the parent that use the module.

Here is my module widget

And here is my parent widget

I want to be able to bind the text from the parent and not from the child module. I there a way to have some thing like below in the parent using my module widget ?

image

Thank you !

Quite doable. Do note that function / property bindings execute every frame, non stop, so it’s not too efficient. Probably irrelevant unless it’s hundreds of widgets, though. Ask yourself if you must update the value 120 times per second… If not, do look into driving updates with events instead.


If you must do it this way:

• create a variable of parent type in the child
• on parent’s Construct, set the child’s variable’s value to Self, thus creating a hard reference
• the child can now access parent’s variables via property bindinn

Thanks for the quick response !

Indeed for what I need in this case, it is not really efficient and I will change the way to do it. But I still want to try it, in case I do need it later.

So I created a variable of my parent

On my parent’s Construct I set the variable to self
image

But I do not see parent’s variables via property binding, what did I missunderstood ?
image

And does this solution work if I want to set diffirent text of the same child module ?
image
image

Hm, I guess this only works for actors, my bad:

image

In that case you’d need to create a regular function binding:

image

But then, as above, if you’re reusing user widgets you’d need give them identifiers so they know which piece data to pull. May get fussy and convoluted; It’s not the best method to start with.

Give it a try, it may work OK for something relatively simple.


On the other hand, wouldn’t it be easier to:

  • in the parent:

Whenever the parent receives an update, they propagate it to any child they need. And this is even before we talk about event dispatchers.

Ok thanks for your help! :slight_smile:

I thought there was already an option done for doing this that I was missing.

I’ll go for the second option that fits more to my needs.

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