star2 Posted December 16, 2007 Share Posted December 16, 2007 here's the GUI again it keeps on flickering and doesn't work as I expected yesterday I tried all night to figure it up but no use can anyone help? expandcollapse popup#include <guiconstants.au3> GUICreate("test", 150, 100) $check_1 = GUICtrlCreateCheckbox("check-1", 10, 20) $check_2 = GUICtrlCreateCheckbox("check-2", 80, 20) $apply = GUICtrlCreateButton("Apply", 10, 60, 130) GUICtrlSetState(-1, $gui_disable) $chk_1 = IniRead("test.ini", "checks", "chk_1", 4) If $chk_1 = 1 Then GUICtrlSetState($check_1, $GUI_CHECKED) ElseIf $chk_1 = 4 Then GUICtrlSetState($check_1, $GUI_UNCHECKED) EndIf $chk_2 = IniRead("test.ini", "checks", "chk_2", 4) If $chk_2 = 1 Then GUICtrlSetState($check_2, $GUI_CHECKED) ElseIf $chk_2 = 4 Then GUICtrlSetState($check_2, $GUI_UNCHECKED) EndIf GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If GUICtrlRead($check_1) <> $chk_1 Then If Bitand(GUICtrlGetState($apply),$gui_enable) <> $gui_enable Then GUICtrlSetState($apply, $gui_enable) Else If Bitand(GUICtrlGetState($apply),$gui_disable) <> $gui_disable Then GUICtrlSetState($apply, $gui_disable) EndIf If GUICtrlRead($check_2) <> $chk_2 Then If Bitand(GUICtrlGetState($apply),$gui_enable) <> $gui_enable Then GUICtrlSetState($apply, $gui_enable) Else If Bitand(GUICtrlGetState($apply),$gui_disable) <> $gui_disable Then GUICtrlSetState($apply, $gui_disable) EndIf If $msg = $apply Then If BitAND(GUICtrlRead($check_1), $GUI_CHECKED) = $GUI_CHECKED Then IniWrite("test.ini", "checks", "chk_1", 1) $chk_1 = 1 Else IniWrite("test.ini", "checks", "chk_1", 4) $chk_1 = 4 EndIf If BitAND(GUICtrlRead($check_2), $GUI_CHECKED) = $GUI_CHECKED Then IniWrite("test.ini", "checks", "chk_2", 1) $chk_2 = 1 Else IniWrite("test.ini", "checks", "chk_2", 4) $chk_2 = 4 EndIf GUICtrlSetState($apply, $gui_disable) EndIf WEnd [quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u] Link to comment Share on other sites More sharing options...
Developers Jos Posted December 16, 2007 Developers Share Posted December 16, 2007 (edited) Just some advise for you: Put some debug Consolewrite statements in your script to understand why it is flickering. In this case its because one IF disables the Button and the next IF enables it ....and that over and over again. To solve that issue you need to make it one If statement like: If GUICtrlRead($check_1) <> $chk_1 Or GUICtrlRead($check_2) <> $chk_2 Then If BitAND(GUICtrlGetState($apply), $gui_enable) <> $gui_enable Then GUICtrlSetState($apply, $gui_enable) Else If BitAND(GUICtrlGetState($apply), $gui_disable) <> $gui_disable Then GUICtrlSetState($apply, $gui_disable) EndIf Edited December 16, 2007 by Jos 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...
star2 Posted December 16, 2007 Author Share Posted December 16, 2007 Just some advise for you: Put some debug Consolewrite statements in your script to understand why it is flickering. In this case its because one IF disables the Button and the next IF enables it ....and that over and over again. -------------- I really did that yesterday but it didn't work I understand what u said and it's correct when I tried it now it work !! it's drivin me crazy mabey yesterday I was sleepy that's why thank u so much [quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u] Link to comment Share on other sites More sharing options...
mrbond007 Posted December 16, 2007 Share Posted December 16, 2007 (edited) expandcollapse popup#include <guiconstants.au3> GUICreate("test", 150, 100) $check_1 = GUICtrlCreateCheckbox("check-1", 10, 20) $check_2 = GUICtrlCreateCheckbox("check-2", 80, 20) $apply = GUICtrlCreateButton("Apply", 10, 60, 130) GUICtrlSetState(-1, $gui_disable) $chk_1 = IniRead("test.ini", "checks", "chk_1", 4) If $chk_1 = 1 Then GUICtrlSetState($check_1, $GUI_CHECKED) ElseIf $chk_1 = 4 Then GUICtrlSetState($check_1, $GUI_UNCHECKED) EndIf $chk_2 = IniRead("test.ini", "checks", "chk_2", 4) If $chk_2 = 1 Then GUICtrlSetState($check_2, $GUI_CHECKED) ElseIf $chk_2 = 4 Then GUICtrlSetState($check_2, $GUI_UNCHECKED) EndIf GUISetState() AdlibEnable("Control", 500) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Func Control() If GUICtrlRead($check_1) <> $chk_1 Then If Bitand(GUICtrlGetState($apply),$gui_enable) <> $gui_enable Then GUICtrlSetState($apply, $gui_enable) Else If Bitand(GUICtrlGetState($apply),$gui_disable) <> $gui_disable Then GUICtrlSetState($apply, $gui_disable) EndIf If GUICtrlRead($check_2) <> $chk_2 Then If Bitand(GUICtrlGetState($apply),$gui_enable) <> $gui_enable Then GUICtrlSetState($apply, $gui_enable) Else If Bitand(GUICtrlGetState($apply),$gui_disable) <> $gui_disable Then GUICtrlSetState($apply, $gui_disable) EndIf If $msg = $apply Then If BitAND(GUICtrlRead($check_1), $GUI_CHECKED) = $GUI_CHECKED Then IniWrite("test.ini", "checks", "chk_1", 1) $chk_1 = 1 Else IniWrite("test.ini", "checks", "chk_1", 4) $chk_1 = 4 EndIf If BitAND(GUICtrlRead($check_2), $GUI_CHECKED) = $GUI_CHECKED Then IniWrite("test.ini", "checks", "chk_2", 1) $chk_2 = 1 Else IniWrite("test.ini", "checks", "chk_2", 4) $chk_2 = 4 EndIf GUICtrlSetState($apply, $gui_disable) EndIf EndFunc Edited December 16, 2007 by mrbond007 Projects : Space Regain - Memory Fusion - PWGT - Chip-ITGames : BrainPain - BrainPain Director's Cut - ProSpeed Games Pack (New)Vista vs XP : the forbidden fight 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