MRmihailZH Posted June 11, 2019 Share Posted June 11, 2019 Hi, sorry for bad english. I have a question about DGS. I create a window in which I create a button (buttonWindow) and add an event to it, but the function works even if you clicked on the window (wnd). wnd = dgsCreateWindow (...) buttonWindow = dgsCreateButton (...,wnd) addEventHandler ("onDgsMouseClick", buttonWindow, buttonWindowFunction) function buttonWindowFunction () ... end How can I fix this? Thank you in advance! Link to comment
Hugos Posted June 11, 2019 Share Posted June 11, 2019 (edited) 2 hours ago, MRmihailZH said: Hi, sorry for bad english. I have a question about DGS. I create a window in which I create a button (buttonWindow) and add an event to it, but the function works even if you clicked on the window (wnd). wnd = dgsCreateWindow (...) buttonWindow = dgsCreateButton (...,wnd) addEventHandler ("onDgsMouseClick", buttonWindow, buttonWindowFunction) function buttonWindowFunction () ... end How can I fix this? Thank you in advance! Didn't understand the code a bit, but try so! function button() buttonWindow = dgsCreateButton() addEventHandler("onDgsMouseClick", buttonWindow, buttonWindowFunction) end addEventHandler("onClientResourceStart", root, button) function buttonWindowFunction() dgsCreateWindow() end write the required parameters in parentheses: https://wiki.multitheftauto.com/wiki/DgsCreateButton https://wiki.multitheftauto.com/wiki/DgsCreateWindow Edited June 11, 2019 by Hugos Link to comment
edge Posted June 11, 2019 Share Posted June 11, 2019 (edited) Replace this: addEventHandler ("onDgsMouseClick", buttonWindow, buttonWindowFunction) with: addEventHandler ("onDgsMouseClick", buttonWindow, buttonWindowFunction, false) Edited June 11, 2019 by edge 1 Link to comment
MRmihailZH Posted June 12, 2019 Author Share Posted June 12, 2019 14 hours ago, edge said: Replace this: addEventHandler ("onDgsMouseClick", buttonWindow, buttonWindowFunction) with: addEventHandler ("onDgsMouseClick", buttonWindow, buttonWindowFunction, false) Thank you very much! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now