ShortShot14 Posted May 10, 2009 Share Posted May 10, 2009 How do i enter a command like... i made a GUI in Koda and copy and pasted the code into SciTe and i wanna launch the command CODESend("{Enter}") But i dont know how?? Link to comment Share on other sites More sharing options...
MrMitchell Posted May 10, 2009 Share Posted May 10, 2009 What are you trying to do? Click a button and make it do something? I don't understand... Link to comment Share on other sites More sharing options...
ShortShot14 Posted May 10, 2009 Author Share Posted May 10, 2009 Yea thats what im trying to do Link to comment Share on other sites More sharing options...
MrMitchell Posted May 10, 2009 Share Posted May 10, 2009 (edited) First you need to learn GUI Concepts, like the difference between OnEvent and Message modes. When you created a GUI with Koda there was a way to select which type of GUI you want to use. It will even create a function for each action on a control. If you made a button Koda can create a function to run if the button is pressed. If you made a checkbox there should be a function to run when it gets checked or unchecked... I know for sure it does this in OnEvent mode if you tell it to... Is there a "Opt("GUIOnEventMode", 1)" at the top of the code? If it's there and it's a 1 that means you're using OnEvent Mode. Edit: How to put your GUI into OnEvent mode... Go to Tools --> Generating Options or Ctrl+F9 Check "Generate OnEvent Code" and "Generate Events for all Controls" Do that and you'll see what I mean. If you want to see a working example the help file has an OnEvent GUI example. Here's one... #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) ; Change to OnEvent mode $mainwindow = GUICreate("Hello World", 200, 100) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUICtrlCreateLabel("Hello world! How are you?", 30, 10) $okbutton = GUICtrlCreateButton("OK", 70, 50, 60) GUICtrlSetOnEvent($okbutton, "OKButton") GUISetState(@SW_SHOW) While 1 Sleep(1000) ; Idle around WEnd Func OKButton() ;Note: at this point @GUI_CTRLID would equal $okbutton, ;and @GUI_WINHANDLE would equal $mainwindow MsgBox(0, "GUI Event", "You pressed OK!") EndFunc Func CLOSEClicked() ;Note: at this point @GUI_CTRLID would equal $GUI_EVENT_CLOSE, ;and @GUI_WINHANDLE would equal $mainwindow MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...") Exit EndFunc Edited May 10, 2009 by MrMitchell Link to comment Share on other sites More sharing options...
ShortShot14 Posted May 10, 2009 Author Share Posted May 10, 2009 (edited) ohh Okay thank you! Edited May 10, 2009 by ShortShot14 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