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
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.