theguy0000 Posted August 20, 2005 Share Posted August 20, 2005 how do i call a function when a button is clicked? thanks! The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
Valuater Posted August 20, 2005 Share Posted August 20, 2005 You should explain more.. and if you have code... show us so we can see what you are working with... every time you post ( i had to ask you this last time too!) 8) Link to comment Share on other sites More sharing options...
theguy0000 Posted August 20, 2005 Author Share Posted August 20, 2005 ok lol lets say i have a function called myFunction. when someone clicks a button in a GUI i want it to call myFunction. The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
Valuater Posted August 20, 2005 Share Posted August 20, 2005 (edited) mostly copied from help files #include <GUIConstants.au3> GUICreate("My GUI Button"); will create a dialog box that when displayed is centered Opt("GUICoordMode",2) $OK = GUICtrlCreateButton ("OK", 10, 30, 50) $Close = GUICtrlCreateButton ( "Close", 0, -1) GUISetState () ; will display an dialog box with 2 button ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $OK then Call("ShowMessage") If $msg = $Close then Call("Terminate") If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Func Terminate() Exit 0 EndFunc Func ShowMessage() MsgBox(4096,"","This is a message from a function.") EndFunc check out help files.... at the bottom are small scripts to see what they do 8) looks just like you said call "myfunction" with parenthacies Edited August 20, 2005 by Valuater 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