crashdemons Posted June 29, 2007 Posted June 29, 2007 I am having a problem where several buttons on a GUI dont seem to want to play well with GUISetOnEvent But external things like the close, restore and minimize buttons trigger correctly There are no errors when ran, but the the "Enable" button ($button) never triggers the enableit() function when clicked..... However, the close button does trigger CloseApp1() This is kind of frustrating as I have used OnEvent mode in other applications that seem to work correctly. Please tell me if something is wrong here: #function definition Func CloseApp1() Exit EndFunc Func enableit() msgbox(0,"Enabled","Success") EndFunc #GUI creation $gui=GUICreate("GUI",150,180) $button=GUICtrlCreateButton("Enable",0,40,150,20) GUISetState(@SW_SHOW,$gui) #GUI triggers Opt("GUIOnEventMode", 1) ; Change to OnEvent mode GUISetOnEvent($GUI_EVENT_CLOSE,"CloseApp1") GUISetOnEvent($button,"enableit") #hold open while 1 sleep(500) WEnd My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)
sandyd Posted June 29, 2007 Posted June 29, 2007 Have you overlooked: Opt("GUIOnEventMode", 0) ;0=disabled, 1=OnEvent mode enabled ----[ SandyD ]---
MHz Posted June 29, 2007 Posted June 29, 2007 Remember that there is OnEvent functions for Gui and OnEvent functions for Controls.GUISetOnEvent($GUI_EVENT_CLOSE,"CloseApp1") <-- GuiGUICtrlSetOnEvent($button,"enableit") <-- Ctrl
crashdemons Posted June 30, 2007 Author Posted June 30, 2007 Remember that there is OnEvent functions for Gui and OnEvent functions for Controls.GUISetOnEvent($GUI_EVENT_CLOSE,"CloseApp1") <-- GuiGUICtrlSetOnEvent($button,"enableit") <-- CtrlThat's it ...I called it correctly in my other programs Thanks, lol what an embarassing mistake. :"> My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)
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