Jump to content

Button-Event gets triggered by click on Window


manuelhimmler

Recommended Posts

Syntax
bool addEventHandler ( string eventName, element attachedTo, function handlerFunction, [bool getPropagated = true] )

Optional Arguments

getPropagated: A boolean representing whether the handler will be triggered if the event was propagated down or up the element tree (starting from the source), and not triggered directly on attachedTo (that is, handlers attached with this argument set to false will only be triggered if source == this).

https://wiki.multitheftauto.com/wiki/AddEventHandler

In the Element Tree, a GUI window's buttons are children of the GUI window. When you click on the GUI window, the event propagates down the tree, and finds the buttons. If their event handlers have "getPropagated = true" then they receive the event and react as though you clicked on them.

Just set that final argument false on your button event handlers.

And learn how the event system works. :P

Link to comment

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