I had problems with popupmenu.show() if menu was to long or user did not select anything.
Then program would often GPV.
I found, that best solution is to create new method in a library, that shows popup menu.
In that case paradox does not GPV.
So I have a library showpop.lsl with only one method:
method ShowPopUpMenu(var m PopUpMenu) String
var s string
endVar
s = ""
try
s = m.Show()
onFail
s = ""
endTry
if not s.isAssigned() then s = "" endIf
if s.isSpace() then s = "" endIf
return(s)
endMethod
The I use this method.
Instead of:
var m PopUpMenu
and string
endVar
m.addText("a")
m.addText("b")
ans = m.Show()
Now I use
var m PopUpMenu
ans string
l library
endVar
m.addText("a")
m.addText("b")
l.open("showpop")
ans = l.
ShowPopUpMenu(m)
Maybe you can try the same with FileBrowser.
Move it to separate library.
I use this code for selecting files:
fbi.Title =
"Choose file"
stFilter = "All files|*.*||"
fbi.CustomFilter = filter
stPath = ":WORK:"
addAlias("OpenFile", "Standard",
stPath )
fbi.Alias = "OpenFile"
if fileBrowser(fName,fbi) then
if
fName.isSpace() then
removeAlias("OpenFile")
return(
fName)
endIf
if getAliasPath(fbi.Alias)<>"" then
stPath = getAliasPath(fbi.Alias)+"\\"
else
stPath = fbi.Alias
endif
fName =
stPath + fbi.Path+
fName
removeAlias("OpenFile")
Jure