star2 Posted December 15, 2007 Share Posted December 15, 2007 (edited) ok here's my GUI #include <guiconstants.au3> GUICreate ("test" , 150 , 100) $check = GUICtrlCreateCheckbox ("check-1" , 10 , 20) $apply = GUICtrlCreateButton ("Apply" , 10 , 60 , 130) GUICtrlSetState (-1 , $gui_disable) $chk_1 = IniRead("test.ini" , "checks","chk_1",0) If $chk_1 = 1 Then GUICtrlSetState ($check , $GUI_CHECKED) ElseIf $chk_1 = 4 Then GUICtrlSetState ($check , $GUI_UNCHECKED) EndIf GUISetState () While 1 $msg = GUIGetMsg () If $msg = $GUI_EVENT_CLOSE Then ExitLoop If GUICtrlRead ($check) <> $chk_1 Then GUICtrlSetState ($apply , $gui_enable) Else GUICtrlSetState ($apply , $gui_disable) EndIf If $msg = $apply Then If BitAND(GUICtrlRead($check),$GUI_CHECKED) = 1 THen IniWrite ("test.ini","checks","chk_1",1) GUICtrlSetState ($apply , $gui_disable) Else IniWrite ("test.ini","checks","chk_1",4) GUICtrlSetState ($apply , $gui_disable) EndIf EndIf WEnd I really don't know what am I missing? all what I want is to make the script senses any changes on the checkbox and also the button is always flickering can anyone help?ini___au3_files.zip Edited December 15, 2007 by star2 [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...
PantZ4 Posted December 15, 2007 Share Posted December 15, 2007 (edited) I put a small Sleep(10) in and it did less flicking but still some. I would guess you just check it too offen. Edit: #include <guiconstants.au3> GUICreate ("test" , 150 , 100) $check = GUICtrlCreateCheckbox ("check-1" , 10 , 20) $apply = GUICtrlCreateButton ("Apply" , 10 , 60 , 130) GUICtrlSetState (-1 , $gui_disable) $chk_1 = IniRead("test.ini" , "checks","chk_1",0) If $chk_1 = 1 Then GUICtrlSetState ($check , $GUI_CHECKED) ElseIf $chk_1 = 4 Then GUICtrlSetState ($check , $GUI_UNCHECKED) EndIf GUISetState () While 1 $msg = GUIGetMsg () If $msg = $GUI_EVENT_CLOSE Then ExitLoop If GUICtrlRead ($check) <> $chk_1 Then GUICtrlSetState ($apply , $gui_enable) Else GUICtrlSetState ($apply , $gui_disable) EndIf If $msg = $apply Then If BitAND(GUICtrlRead($check),$GUI_CHECKED) = 1 THen IniWrite ("test.ini","checks","chk_1",1) GUICtrlSetState ($apply , $gui_disable) Else IniWrite ("test.ini","checks","chk_1",4) GUICtrlSetState ($apply , $gui_disable) EndIf EndIf Sleep(10) WEnd Edited December 15, 2007 by Mr. Zero Link to comment Share on other sites More sharing options...
star2 Posted December 15, 2007 Author Share Posted December 15, 2007 (edited) ok thanks I don't think this is a good way to solve the flickering problem but the problem is to make the script sense changes Edited December 15, 2007 by star2 [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 15, 2007 Developers Share Posted December 15, 2007 try this version: #include <guiconstants.au3> GUICreate("test", 150, 100) $check = GUICtrlCreateCheckbox("check-1", 10, 20) $apply = GUICtrlCreateButton("Apply", 10, 60, 130) GUICtrlSetState(-1, $gui_disable) $chk_1 = Number(IniRead("test.ini", "checks", "chk_1", 1)) If $chk_1 = 1 Then GUICtrlSetState($check, $GUI_CHECKED) ElseIf $chk_1 = 4 Then GUICtrlSetState($check, $GUI_UNCHECKED) EndIf GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If GUICtrlRead($check) <> $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 $msg = $apply Then If BitAND(GUICtrlRead($check), $GUI_CHECKED) = 1 Then IniWrite("test.ini", "checks", "chk_1", 1) GUICtrlSetState($apply, $gui_disable) Else IniWrite("test.ini", "checks", "chk_1", 4) GUICtrlSetState($apply, $gui_disable) EndIf EndIf WEnd 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 15, 2007 Author Share Posted December 15, 2007 try this version:it stopped the flickering but I think I'm not explaining the problem currectlyafter pressing the apply button some data will be written in the ini file and the button should be diabledbut if there was a change in the state of the checkbox the apply button state should be enablewhat I mean isthe script should feel the changes and act according to itwith any change of the checkbox the apply button should be enabledafter pressing the apply button the button itself should be disabled [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 15, 2007 Developers Share Posted December 15, 2007 (edited) you also need to update the var $chk_1 #include <guiconstants.au3> GUICreate("test", 150, 100) $check = GUICtrlCreateCheckbox("check-1", 10, 20) $apply = GUICtrlCreateButton("Apply", 10, 60, 130) GUICtrlSetState(-1, $gui_disable) $chk_1 = Number(IniRead("test.ini", "checks", "chk_1", 1)) If $chk_1 = 1 Then GUICtrlSetState($check, $GUI_CHECKED) ElseIf $chk_1 = 4 Then GUICtrlSetState($check, $GUI_UNCHECKED) EndIf GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If GUICtrlRead($check) <> $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 $msg = $apply Then If BitAND(GUICtrlRead($check), $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 $rc = GUICtrlSetState($apply, $gui_disable) EndIf WEnd Edited December 15, 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 15, 2007 Author Share Posted December 15, 2007 u've got me Jos thanks alot !! [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...
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