If you have a relatively new version of LO, you can use the ScriptForge PopupMenu service which is explained in detail here:
https://help.libreoffice.org/7.5/en-US/text/sbasic/shared/03/sf_popupmenu.html?DbPAR=BASIC
A snippet of an example from that page is:
Sub ShowPopup
GlobalScope.BasicLibraries.loadLibrary("ScriptForge")
Dim myPopup As Object
Set myPopup = CreateScriptService("SFWidgets.PopupMenu", , 300, 300)
myPopup.AddItem("Item ~A")
myPopup.AddItem("Item ~B")
vResponse = myPopup.Execute()
MsgBox("Selected item ID: " & vResponse)
myPopup.Dispose()
End Sub
I’ve been using this in a project of my own. It sounds like just the kind of thing you want.