spawning PopupInput Dialogue #22
-
Hey @hossimo and everyone else, I am trying to spawn a PopupInput in the current MA3 Version (v1.4.0.2) but cant get it working.
What am I doing wrong? Kind regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The issue is because the second argument of PopupInput() is looking for a In the system monitor you should notice an error like this: It's not 1000% clear but what it is saying is the second argument is the wrong type. it's looking for a LUA lightuserdata object but instead it got something else, local function Main(display_handle,argument)
local r = PopupInput("TITLE", display_handle, {{"str", "String", nil}, {"int","Number", 123}}, "123", 100, 200)
end In this case If Two ways around this:1) Get the display HandleI had noticed some functions in the API like local function Main(display_handle,argument)
Echo(HandleToInt(display_handle)) -- returned 838861405
end
return Main Then I used this number on the command line: lua 'local r = PopupInput("TITLE", IntToHandle(838861405), {{"str", "String", nil}, {"int","Number", 123}}, "123", 100, 200)' And it worked, HOWEVER this number probably changes for each session, so you would need some way to find this number. 2) Use GetDisplayByIndex()
Some guessing on my part but I believe Hope this helps. |
Beta Was this translation helpful? Give feedback.
The issue is because the second argument of PopupInput() is looking for a
display_handle
.In the system monitor you should notice an error like this:
It's not 1000% clear but what it is saying is the second argument is the wrong type. it's looking for a LUA lightuserdata object but instead it got something else,
display_handle
, which in this context is likelynil
. In a proper LUA file you will notice that the main function of your program has adisplay_handle
argument:In this case
display_handle
passed in via the system to t…