Common UI: How to deactivate another widget?

Im using Common UI and Have one menue which opens another menue. When I choose from the second menue I want both Menues to close. Deactivate widget only deactivates the second menue, but I also want the first menue to be deactivated. How can I do this?
I tried Creating a variable for the previous menue but that didnt work:

When you construct it are you passing in the self variable?

Create the variable of the first one in the secound widget, expose on spawn, instance editable… then when you construct the 2nd widget youll pass in the reference… to self

Sorry i did´nt follow…
When I construct the variable? I created it by adding a new variable and as type I searched for the common activatable widget that is my first menu.

I did expose on spawn as shown in the screenshot.
I dont understand “then when you construct the 2nd widget youll pass in the reference… to self”…
There are two nodes to deactivate because the first node is to deactivate the first menu via the variable and the second on to deactivate the second menu which is where the screenshot was taken from.
Sorry bit of a noob here

Are you using the construct widget node
or in other words how is the 2nd widget added to the screen?

Does it just already exist in the 1st one or do you add it somehow, either to viewport or to a canvas panel, horizontal box, etc?


^ Construct widget

VS


^ It exists inside another widget

seeing just a little bit more than just those 2.5 Nodes in your picture will help :slight_smile:

Thanks for you answer!
I have a CommonUserWidget with a common activatable widget stack.
In menue 1 I create a reference to that widget and then I push menue2 to that stack. (actually there are 3 stacks to layer the menues…)
Another solution might be to access that CommonUserWidget stack and clear it from there but I haven´t been able to figure that out.

This is Menu1 from witch I push menu2 via the widget stack:

This is Menu2 from witch i want to be able to deactivate menue1 from:

Im not familiar with creating child widgets

You´re second option seems to be to create a menue within the same widget? Not sure how that would handle controller use for focusing the correct buttons…

Ive never actually seen the push widget stack, tbh havent done anything with that yet in widgets

As far as controllers and focus theres a node to set the focus, but by default it goes to whichever is on top beacuse it was created last it has the focus ie controls input

So while i cant really tell you anything about widget stacks i can further explain what i have going on in my little snippet i stole from one of my projects

I have a quest widget which displays within the hud widget ( widget in a widget ), on the quest widget itself there is just a container ( scroll box ) that i then construct an objective widget that takes in the variables needed to display its name and goals etc and then that is just added to the scroll box, it does also take in a reference to the quest widget itself, to be able to grab things from the quest widget… all ive done to do that is set the variable to expose on spawn…

Dragging off of the scroll box or similar you can easily do clear children

If your not able to get this to work something you could do is use a widget switcher and change to it… or if your going more for the pop up style a 2nd canvas panel on top that is simple hidden by default that you can then enable when you need it, its also worth mentioning you can have individual elemnts change their visability as well if you were to do it all in one widget… but this can lead to some really funky behavior of the bp if not used correctly

Ill have to watch some videos on how widget stacks/layers work to tell you anything specificly about what your trying to figure out here

Ill see if i cant figure something out and update you here if i do

Maybe This will help, not sure… id have to play with it myself to really tell you, im currently away from computer… but unless your having a specific reason to use the plugin you are to make those widgets its probabbly far simpler in just a regular WidgetBlueprint

Create the first one, and have a horizontal box or canvas panel or something… and just add the new widget to that with the node “construct widget” ( which will show any “expose on spawn” variables ( you can also fairly easily create a custom event to destroy it and use an event dispatcher from the 2nd one to trigger it ))

Method 2 would be just have a widget switcher in there if you dont need to see both at the same time… or you could throw the widget switcher into a horizontal box with the other elements such that now you can control what is on the right side of the screen

Inside the widget switcher you could have a canvas panel with nothing in it for when you want to be able to see whatever may be behind it, a 2nd canvas panel for your inventory options, a third for settings etc, whatever you want really

But unfortunately thats about all i have to offer you short of looking up and sending you videos thst you could likely just as easily find on your own

If you search on YT/Google you could try searching “Wtf is xyz” and theres usually a decent tutorial on each widget element by that guy

Thanks for trying. CommonUI is so ■■■■ hard to just to the simplest of things (as a hobbyists)

I’m sure it has it’s purpose/use but i can’t see what it does that isn’t just easier to do with the included in engine :sweat_smile: