Sign in to follow this  
MRmihailZH

[HELP] DGS System

Recommended Posts

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! :) 

Share this post


Link to post
Posted (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 by Hugos

Share this post


Link to post
14 hours ago, edge said:

Replace this:


addEventHandler ("onDgsMouseClick", buttonWindow, buttonWindowFunction)

with:


addEventHandler ("onDgsMouseClick", buttonWindow, buttonWindowFunction, false)

 

Thank you very much!

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.