Orgins Posted May 18, 2007 Share Posted May 18, 2007 (edited) I've got a main gui with a button that pops up a 2nd gui. The 2nd gui has a button when that button is pushed GUIDelete() is called and closes that 2nd gui out. But after that the first GUI is still there (which I want) and the button don't seem to work (which I don't want). Should I be using something beside GUIdelete? if so which one? Edited May 18, 2007 by Orgins I'm a newbie.Sorry if I don't reposed to your replays very fast. Link to comment Share on other sites More sharing options...
James Posted May 18, 2007 Share Posted May 18, 2007 Gui Delete goes into the second gui. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
GaryFrost Posted May 18, 2007 Share Posted May 18, 2007 Post a script showing your problem and we can help you quicker. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Developers Jos Posted May 18, 2007 Developers Share Posted May 18, 2007 (edited) Post a script showing your problem and we can help you quicker.Why ... you can't help him without it ? guess you're loosing your powers ... Edited May 18, 2007 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
GaryFrost Posted May 18, 2007 Share Posted May 18, 2007 Why ... you can't help him without it ? guess you're loosing your powers ... Must of left them over in Holland.... SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Orgins Posted May 18, 2007 Author Share Posted May 18, 2007 (edited) When I click set timer and then done on the 2nd gui the first gui buttons won't work anymore. Its more or less this (striped out most of the code): expandcollapse popup#include <GUIConstants.au3> #include <IE.au3> Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") GUICreate("Gui1", 400, 280, 250, 156) $Pic1 = GUICtrlCreatePic("pic.jpg", -8, -8, 450, 290, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS)) GUICtrlSetState(-1, $GUI_DISABLE) $MyButton1 = GUICtrlCreateButton("Start", 24, 216, 100, 30, $BS_FLAT) $MyButton2 = GUICtrlCreateButton("Exit", 24, 248, 100, 30, $BS_FLAT) $MyButton3 = GUICtrlCreateButton("Set timer", 128, 218, 100, 30, $BS_FLAT) GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Select Case $Msg = $GUI_EVENT_CLOSE ExitLoop Case $Msg = $MyButton1 start() Case $Msg = $MyButton2 Exit 0 Case $Msg = $MyButton3 Settimer() EndSelect WEnd Func start() ;Some code that I know works. EndFunc Func Settimer() GUICreate("Set timer", 194, 145, 363, 226) $Pic1 = GUICtrlCreatePic("pic.jpg", -8, -8, 200, 250, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS)) GUICtrlSetState(-1, $GUI_DISABLE) $Input1d = GUICtrlCreateInput(IniRead("info.ini", "timer", "1", "1500"), 8, 40, 81, 21) $Input2d = GUICtrlCreateInput(IniRead("info.ini", "timer", "2", "2500"), 104, 40, 81, 21) $Input3d = GUICtrlCreateInput(IniRead("info.ini", "timer", "3", "2500"), 8, 80, 81, 21) $Input4d = GUICtrlCreateInput(IniRead("info.ini", "timer", "4", "3500"), 104, 80, 81, 21) $Delay = GUICtrlCreateLabel("timer 1 min", 8, 24, 91, 17) $Label1d = GUICtrlCreateLabel("max", 104, 24, 56, 17) $Label2d = GUICtrlCreateLabel("timer 2 min", 8, 64, 96, 17) $Label3d = GUICtrlCreateLabel("max", 104, 64, 96, 17) $Done = GUICtrlCreateButton("Done", 48, 104, 100, 30, $BS_FLAT) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Done $Delay1 = GUICtrlRead($Input1d) $Delay2 = GUICtrlRead($Input2d) $Delay3 = GUICtrlRead($Input3d) $Delay4 = GUICtrlRead($Input4d) IniWrite("info.ini", "timer", "1", $Delay1) IniWrite("info.ini", "timer", "2", $Delay2) IniWrite("info.ini", "timer", "3", $Delay3) IniWrite("info.ini", "timer", "4", $Delay4) GUIDelete() ; This is where I'm stuck. It kills the 2nd gui and the first one buttons stop working EndSwitch WEnd EndFunc Func TogglePause() $Paused = Not $Paused While $Paused Sleep(500) ToolTip("script is paused", 0, 0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Edited May 18, 2007 by Orgins I'm a newbie.Sorry if I don't reposed to your replays very fast. Link to comment Share on other sites More sharing options...
GaryFrost Posted May 18, 2007 Share Posted May 18, 2007 You weren't exiting the loop expandcollapse popup#include <GUIConstants.au3> #include <IE.au3> Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") GUICreate("Gui1", 400, 280, 250, 156) $Pic1 = GUICtrlCreatePic("pic.jpg", -8, -8, 450, 290, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS)) GUICtrlSetState(-1, $GUI_DISABLE) $MyButton1 = GUICtrlCreateButton("Start", 24, 216, 100, 30, $BS_FLAT) $MyButton2 = GUICtrlCreateButton("Exit", 24, 248, 100, 30, $BS_FLAT) $MyButton3 = GUICtrlCreateButton("Set timer", 128, 218, 100, 30, $BS_FLAT) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $MyButton1 start() Case $MyButton2 Exit 0 Case $MyButton3 Settimer() EndSwitch WEnd Func start() While 1 ;Some code that I know works. WEnd EndFunc ;==>start Func Settimer() $GUI_Timer = GUICreate("Set timer", 194, 145, 363, 226) $Pic1 = GUICtrlCreatePic("pic.jpg", -8, -8, 200, 250, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS)) GUICtrlSetState(-1, $GUI_DISABLE) $Input1d = GUICtrlCreateInput(IniRead("info.ini", "timer", "1", "1500"), 8, 40, 81, 21) $Input2d = GUICtrlCreateInput(IniRead("info.ini", "timer", "2", "2500"), 104, 40, 81, 21) $Input3d = GUICtrlCreateInput(IniRead("info.ini", "timer", "3", "2500"), 8, 80, 81, 21) $Input4d = GUICtrlCreateInput(IniRead("info.ini", "timer", "4", "3500"), 104, 80, 81, 21) $Delay = GUICtrlCreateLabel("timer 1 min", 8, 24, 91, 17) $Label1d = GUICtrlCreateLabel("max", 104, 24, 56, 17) $Label2d = GUICtrlCreateLabel("timer 2 min", 8, 64, 96, 17) $Label3d = GUICtrlCreateLabel("max", 104, 64, 96, 17) $Done = GUICtrlCreateButton("Done", 48, 104, 100, 30, $BS_FLAT) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $Done $Delay1 = GUICtrlRead($Input1d) $Delay2 = GUICtrlRead($Input2d) $Delay3 = GUICtrlRead($Input3d) $Delay4 = GUICtrlRead($Input4d) IniWrite("info.ini", "timer", "1", $Delay1) IniWrite("info.ini", "timer", "2", $Delay2) IniWrite("info.ini", "timer", "3", $Delay3) IniWrite("info.ini", "timer", "4", $Delay4) GUIDelete($GUI_Timer) ; This is where I'm stuck. It kills the 2nd gui and the first one buttons stop working ExitLoop EndSwitch WEnd EndFunc ;==>Settimer Func TogglePause() $Paused = Not $Paused While $Paused Sleep(500) ToolTip("script is paused", 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. 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