FSXTim Posted May 20, 2012 Share Posted May 20, 2012 I have two windows and I want to bring one of them to the front. But it's still in the background! function OpenRules_Button (state) if state == "left" then if source == GUIEditor_Button1 or source == GUIEditor_Button3 then guiSetVisible(Regeln_Window, true) guiBringToFront (Regeln_Window) end end end addEventHandler("onClientGUIClick", getRootElement(), OpenRules_Button) Can anybody help me? Greets Link to comment
Jaysds1 Posted May 20, 2012 Share Posted May 20, 2012 try this: function OpenRules_Button (button,state) -- there's one more argument before state is defineed if state == "left" then if source == GUIEditor_Button1 or source == GUIEditor_Button3 then guiSetVisible(Regeln_Window, true) guiBringToFront (Regeln_Window) end end end addEventHandler("onClientGUIClick",guiRoot, OpenRules_Button) --defined root as guiRoot I've add a couple of comments for you Link to comment
FSXTim Posted May 20, 2012 Author Share Posted May 20, 2012 @Jaysds1: Thanks, but: That should work. I tried again and it's working now. I'm sure I did something wrong! Thanks Greets Link to comment
Castillo Posted May 20, 2012 Share Posted May 20, 2012 I didn't do anything, but well. Link to comment
Jaysds1 Posted May 20, 2012 Share Posted May 20, 2012 @Jaysds1: Thanks, but:That should work. I tried again and it's working now. I'm sure I did something wrong! Thanks Greets np Link to comment
Stanley Sathler Posted May 20, 2012 Share Posted May 20, 2012 You're using GUI Editor? Why the variable names are not GUIEditor_Button[1] and GUIEditor_Button[3]? '-' 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