Arrrghmatey Posted August 2, 2005 Posted August 2, 2005 I have a function that generates a window based on the array I want to send it. I want to click a button and have it send the function a parameter (the array) and the window will be created. However, with GuiCtrlSetOnEvent you just specify the name of the function. ie: GuiCtrlSetOnEvent($buttonOk, "startTest") Func startTest($testName) ;<-- how do I send this using the $buttonOk button? ;do something EndFunc
jpm Posted August 2, 2005 Posted August 2, 2005 I have a function that generates a window based on the array I want to send it. I want to click a button and have it send the function a parameter (the array) and the window will be created. However, with GuiCtrlSetOnEvent you just specify the name of the function. ie:GuiCtrlSetOnEvent($buttonOk, "startTest") Func startTest($testName) ;<-- how do I send this using the $buttonOk button? ;do something EndFunc<{POST_SNAPBACK}>You need to define $testName as a global variable at the begining of your script.
Arrrghmatey Posted August 2, 2005 Author Posted August 2, 2005 You need to define $testName as a global variable at the beginning of your script. <{POST_SNAPBACK}>I will have many different names that can be sent, so the window is generated on the fly. My intention is that depending on what button is pressed, a value is sent, then the window made based on that value. Otherwise, I might just have to make a function for each button? That would be wasteful, because I have many, many buttons....
Zedna Posted August 2, 2005 Posted August 2, 2005 I will have many different names that can be sent, so the window is generated on the fly. My intention is that depending on what button is pressed, a value is sent, then the window made based on that value. Otherwise, I might just have to make a function for each button? That would be wasteful, because I have many, many buttons....<{POST_SNAPBACK}>And what about @GUI_CTRLID (@GUI_CtrlId --> Last click GUI Control identifier)This is in Helpfile in the example for GUICtrlSetOnEvent ...This means: One function and Select case statement by @GUI_CTRLID for every control (button). Resources UDF ResourcesEx UDF AutoIt Forum Search
Arrrghmatey Posted August 2, 2005 Author Posted August 2, 2005 And what about @GUI_CTRLID (@GUI_CtrlId --> Last click GUI Control identifier)This is in Helpfile in the example for GUICtrlSetOnEvent ...This means: One function and Select case statement by @GUI_CTRLID for every control (button).<{POST_SNAPBACK}>Thank you!!! I'm not sure how I missed that. I think I just looked through the actual documentation and not the examples. Thanks!
jpm Posted August 2, 2005 Posted August 2, 2005 I don't know how to give more info. it is describe in the remark :"> RemarksOnEvent functions are only called when the option GUIOnEventMode is set to 1 - when in this mode GUIGetMsg is NOT used at all.Within the called user function the control identifier can be retrieved with @GUI_CTRLID.If needed the windows handle and the control handle can be retrieved with @GUI_WINHANDLE or @GUI_CTRLHANDLE.
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