Jump to content

[help] Click on GUI.window triggers click on all the buttons


monday

Recommended Posts

Posted

Is it a bug or that's how it should be? I don't know why but when I click on the window it automatically "clicks" all the buttons inside it. I added event handlers "onClientGUIClick" only for the buttons and left the main window without any functions "onclick"

Posted

* sees your code magically and finds a solution for your problem*

Sorry dude , can't help you like that. Please show us your code.

Posted

when you add the event into the gui-function check if you have boolean ( boolean is a data type either whose value can be true or false)

addEventHandler ( "onClientGUIClick", anybutton, theFunction, false) ---  in this case is false. 

Posted

EXAMPLE:

  
function theFunction() 
gui = guiCreateWindow(float x, float y, float z, "EXAMPLE", false) 
anybutton = guiCreateButton(float x, float y, float z, "CLOSE", false) 
showCursor(true) 
addEventHandler ( "onClientGUIClick", anybutton, close, false) 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, theFunction) 
  
function close() 
guiSetVisible(gui , false) 
showCursor(guiGetVisible(gui)) 
end 
. 

Posted

Thank you very much, I didn't put any true/false there before :)

@Saml1er

The code is very long and not clear because I used guieditor. I thought that describing the issue would be better than just posting the whole thing

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...