Shao Posted March 21, 2006 Share Posted March 21, 2006 hello, I have a problem with a gui. I have a list of GUISetOnEvent($var, function()) used in my gui according this structure : $WINgui = GUICreate("PROCESS CONTROLLER", 600, 660, (@DesktopWidth-600)/2, (@DesktopHeight-660)/2) $FILEmenu = GUICtrlCreateMenu ("&Fichier") $saveconfig = GUICtrlCreateMenuitem ("Sauvegarder la configuration",$FILEmenu) ecc. GUISetOnEvent ($closeitem, close()) GUISetOnEvent ($saveconfig , saveconfig ()) ecc. GUISetState(@SW_SHOW) While 1 Sleep(1000) WEnd this gui is launched from a tray icon. I don't know why does the saveconfig() function is called and executed instead of the close() one. I tried to invert the order of those two GUISetOnEvent and it looks to be the first GUISetOnEvent that is executed ! Can you tell me why ? thanks. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 21, 2006 Moderators Share Posted March 21, 2006 (edited) $WINgui = GUICreate("PROCESS CONTROLLER", 600, 660, (@DesktopWidth-600)/2, (@DesktopHeight-660)/2) $FILEmenu = GUICtrlCreateMenu ("&Fichier") $saveconfig = GUICtrlCreateMenuitem ("Sauvegarder la configuration",$FILEmenu) GUICtrlSetOnEvent ($closeitem, 'close') GUICtrlSetOnEvent ($saveconfig , 'saveconfig') GUISetState(@SW_SHOW) While 1 Sleep(1000) WEnd Edited March 21, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
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