then tried ‘Create widget of class’, didn’t work either, probably cus there’s multiple instances of the widget. It executes the code just fine but doesn’t show any changes made when running game:
Because you ticked Top Level Only. But even if that worked, it would not work in the long run…
tried ‘Create widget of class’, didn’t work either, probably cus there’s multiple instances of the widget.
tl;dr: you’re trying to do something that makes little sense in the context of working with panel views.
Perhaps it would be best to take a step back and study how the ListView works a bit closer first. Because that’s what we’re dealing with here, right? Generally speaking:
you would not modify the widget itself
instead, you would modify the data in the underlying object and regenerate list entries (either all because we’re lazy, it’s convenient and there’s just a handful being kept alive; or regenerate one entry only - a bit more upfront work is needed here)
Identify which widget is supposed to be affected. Once this is known, modify the data in the object that was used to feed the widget data, then refresh the list view; if you do not do this, the change will be temporary only and the list will regenerate entries using stale data
Hi @str4w_b3rrieZ . for what you are doing, I don’t see why you would run “GetAllWidgetsOfClass” as that would return to you every widget of that class create and it may not be the one you want in case there are multiple. Assuming that I understand your code correctly, following might help with your problem.
Set the widget 2 to variable in widget 1. This is assuming you have added Widget 2 in 1 using Designer.
Now you have access to the inside widget here and this also gives you access to event and function inside of widget 2. Following images show case that.
Widget2:
Hello, thank you so much for your reply, I apologize on my lack of knowledge with widgets, I’m a beginner and still learning. The solutions I provided were based on answers I received from previous users
Would you be able to explain this further? I think I’m approaching my problem in the wrong way. I’ll explain my problem better for you:
in the image below I have a bubble that appears behind my image that I added to my list view:
I don’t want that to be there.
The reason why this is happening is because my list view contains both the ‘bubble’ & image.
So when data is passed, from my data structure (as you mentioned), both appear, even when I am only setting data for the image only.
The data structure that passes data to the list view entry:
The issue I noticed is that because the default value of ‘bubble’ has been set it will always appear behind the image. I thought an easy fix would be to just not put a default value, but if i do that, when i add images to my list view, nothing appears.
So this is the issue i’m trying to fix. I thought hiding it would help (probably not now)
So as you said editing the data being passed is a better idea, so how would i go about doing that here?
The Custom Event modifies the data inside the object (not the widget!), and then asks the list view to regenerate all existing widget entries (note this is not as bad as it sounds, the widgets are not destroyed and recreated from scratch but refreshed via the Event On List Item Object Set). The custom event would trigger the script below
this is my Entry Widget that sits inside the List View widget:
When the list view instantiates it (or regenerates it), we pull the data from the ObjListViewData and apply it to the widget. In this example, it would clear the text and hide the text block.
Your job is to fire this event, you must know which entry in the list needs to be modified: