BinaryBrother Posted August 24, 2009 Posted August 24, 2009 I am having some issues with registering events from within functions.Func DoScreenshotFS() ;FadeOut() ;ShotGUI() ;FadeIn() ;Opt("GUIOnEventMode",0) _IENavigate($oIE, 'javascript:ajaxChat.sendMessage("/action is posting a Screenshot...");', 0) $hMain_GUI = GUICreate("ScreenCapture", 280, 50) $hRect_Button = GUICtrlCreateButton("Select Region", 10, 10, 80, 30) $hFS_Button = GUICtrlCreateButton("Entire Screen", 100, 10, 80, 30) $hCancel_Button = GUICtrlCreateButton("Cancel", 190, 10, 80, 30) GUICtrlSetOnEvent($hRect_Button,"test")Notice the last line... I am setting an event trigger from within a function... Is this not suppose to work? That's ALL I need to know... >_<Simple question, simple answer... Issue: GuiCtrlSetOnEvent() Is not firing as I expected.Question: Is this 'proper' behavior? (Not working)I don't need to know how to fix it (Or I would have provided more source), I just need to know if it's proper behavior... SIGNATURE_0X800007D NOT FOUND
Moderators SmOke_N Posted August 24, 2009 Moderators Posted August 24, 2009 All variables in a function are "local" scope variables, unless otherwise noted within the code as "global". Local scope variables are destroyed on the return from the function. If that's not the answer, then provide a re-inactment script that someone can actually run that demonstrates your issue. 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.
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