PowerNovice Posted June 7, 2006 Share Posted June 7, 2006 Please pardon me if this has been asked, before. Any searches I can come up with bring back hundreds of hits. In Event mode, I don't seem to get control when checking or unchecking a box. Here's my program snipped down to its minimum. The msgbox never displays. #include <GUIConstants.au3> opt('guiCloseOnEsc',0) ; don't close when hitting Esc Opt("GUIOnEventMode", 1) ; Change to OnEvent mode $clock = GUICreate("Test",800,600,(@desktopwidth-800)/2, _ (@desktopheight-600)/3, $ws_sysmenu+$ws_caption+$ws_minimizebox) $alarm = guictrlcreateCheckbox('Alarm' ,10,190,90,25) GUISetOnEvent($alarm, "checkbox") GUISetState () GUISetOnEvent($GUI_EVENT_CLOSE, "cleanup") while 1 sleep(1000) wend exit func Cleanup() guiDelete($clock) exit EndFunc func CheckBox() msgbox(0,'debug',checkbox) endfunc Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 8, 2006 Moderators Share Posted June 8, 2006 Please use Code tags when showing your scripts... $alarm is a Control... so you need GUICtrlSetOnEvent(). Also your msgbox(0,'debug',checkbox) is missing quotes around the checkbox string there. 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...
PowerNovice Posted June 8, 2006 Author Share Posted June 8, 2006 Thanks very much for the quick response. I hadn't noticed that there were both GUISetOnEvent and GUICtrlSetOnEvent. Making that change worked. (Sorry about the missing quotes in the msgbox; I cut a few hundred lines and many variables out to make a short test program.) I'm afraid I had never come across the term "code tags". Based on a search (here and Google), do you just mean setting it apart with lines before and after such as: CODE ;some code ENDCODE Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 8, 2006 Share Posted June 8, 2006 I'm afraid I had never come across the term "code tags". Based on a search (here and Google), do you just mean setting it apart with lines before and after such as: CODE ;some code ENDCODE Put square brackets, i.e. [], around the word code at the begining, and /code at the end. The reply editor for this forum site has a button at the top with a # in it that will generate the tags automaticly. Just highlight the code and click the # button. To make it a scrolling code box, use the tags codebox and /codebox (in square brackets). You can also use the tags autoit and /autoit (still in the square brackets) and the web site code will try to color code it the way SciTE would. :-) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
fu2m8 Posted June 8, 2006 Share Posted June 8, 2006 Thanks very much for the quick response. I hadn't noticed that there were both GUISetOnEvent and GUICtrlSetOnEvent. Making that change worked. (Sorry about the missing quotes in the msgbox; I cut a few hundred lines and many variables out to make a short test program.) I'm afraid I had never come across the term "code tags". Based on a search (here and Google), do you just mean setting it apart with lines before and after such as: CODE ;some code ENDCODE yeh, just when you are displaying code on the forum enlcose it in these tags [ code ] this is my code here [ /code ] (without the spaces) Just makes it a lot easier to read and makes the code stand out from the other text in your post. Example: this is my code here ;also some code 3rd line of code 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