Adding a dropdown list to a graphview menu with a popupfield

ive done a little reading and think the best way to make a dropdown list with the items from a list i have would be to use a popupfield.

i have a toolbar in this menu its a visual node graphing menu with the toolbar at the top with buttons on it which i want the dropdown list to appear on to select from a list of gameobjects.

toolbar here is a UnityEditor.UIElements.Toolbar()) that im drawing at the end of the method with
rootVisualElement.Add(toolbar);

ive tried using toolbar.Add(new PopupField(SpeakerList.ToString())); and nothing appears ive ran into a brick wall in lack of documentation i can find and dont know where to look.
any help would be appreciated as im very new to working with graphview.

Add a ToolBarMenu to your Toolbar instead: Unity - Scripting API: ToolbarMenu

aha thankyou

Not a worry. If you are learning about the graph view there is this tutorial:

It’s a bit out of date so some class names and methods might be different nowadays. Referring to the documentation should get you sorted.

Otherwise feel free to give me a shout. I’ve muddled a good bit with graph view.

Otherwise otherwise, if you want a more out of the box working graph view system there’s xnode: GitHub - Siccity/xNode: Unity Node Editor: Lets you view and edit node graphs inside Unity

thanks man thats the video series ive been watching, got to the end and now tryign to apply what ive learned to make it work for my dialogue system