Helge Posted December 30, 2004 Share Posted December 30, 2004 (edited) This is just something I found out while testing something the other day.There might be something logical about it, anyway check this out :$LBS_SORT = 0x0002 $GUI_EVENT_CLOSE = -3 GUICreate("Strange",200,200) $list = GUICtrlCreateList("",10,10,180,150,- $LBS_SORT) $btn = GUICtrlCreateButton("Button",10,170,180,20) GUISetState() AdlibEnable("_close",10) While 1 GUICtrlSetData($list,"line 1|line 2|line 3|line 4") Sleep(1000) If GUICtrlRead($btn) = "line 1|line 2|line 3|line 4" Then GUICtrlSetData($btn,"Fuck off !") Sleep(1000) EndIf Wend Func _close() $msg = GUIGetMsg() If $msg = -3 Then Exit EndFuncNote the use of "- $LBS_SORT"... Edited December 30, 2004 by Helge Link to comment Share on other sites More sharing options...
MHz Posted December 30, 2004 Share Posted December 30, 2004 Maybe a couple of more lines may help? $LBS_SORT = 0x0002 $GUI_EVENT_CLOSE = -3 GUICreate("Strange",200,200) $list = GUICtrlCreateList("",10,10,180,150,- $LBS_SORT) $btn = GUICtrlCreateButton("Button",10,170,180,20) GUISetState() AdlibEnable("_close",10) While 1 GUICtrlSetData($list,"line 1|line 2|line 3|line 4") Sleep(1000) If GUICtrlRead($btn) = "line 1|line 2|line 3|line 4" Then GUICtrlSetData($btn,"Fuck off !") Sleep(1000) GUICtrlSetData($btn,"Should I say that ?") Sleep(1000) EndIf Wend Func _close() $msg = GUIGetMsg() If $msg = -3 Then Exit EndFunc Link to comment Share on other sites More sharing options...
Helge Posted December 30, 2004 Author Share Posted December 30, 2004 Maybe a couple of more lines may help? <{POST_SNAPBACK}>Nah, strange enough that didn't work. Hmm.. Link to comment Share on other sites More sharing options...
Developers Jos Posted December 30, 2004 Developers Share Posted December 30, 2004 Nah, strange enough that didn't work. Hmm.. <{POST_SNAPBACK}>It is not that strange. "- $LBS_SORT" is invalid and the Handle returned by GUICtrlCreateList() = -1.Then GUICtrlSetData($List...) refers to the Last control (-1) , which is the Button, it updates the Button text.Maybe this needs to be checked or the Helpfile updated, since that states that the returned handle will be 0 on error.demo:$LBS_SORT = 0x0002 $GUI_EVENT_CLOSE = -3 GUICreate("Strange",200,200) $list = GUICtrlCreateList("",10,10,180,150,- $LBS_SORT) If $list = -1 then msgbox(0,'','you coded the command wrong !!') $btn = GUICtrlCreateButton("Button",10,170,180,20) GUISetState() AdlibEnable("_close",10) While 1 GUICtrlSetData($list,"line 1|line 2|line 3|line 4") Sleep(1000) If GUICtrlRead($btn) = "line 1|line 2|line 3|line 4" Then GUICtrlSetData($btn,"Fuck off !") Sleep(1000) EndIf Wend Func _close() $msg = GUIGetMsg() If $msg = -3 Then Exit EndFunc 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...
Helge Posted December 30, 2004 Author Share Posted December 30, 2004 (edited) Ok, I know it was a strange code but it was just a test.. And JdeB, do you really think that I was serious when I thought that the additions that MHz did could fix it ? Edited December 30, 2004 by Helge Link to comment Share on other sites More sharing options...
Developers Jos Posted December 30, 2004 Developers Share Posted December 30, 2004 And JdeB, do you really think that I was serious when I thought thatthe additions that MHz did could fix it ? <{POST_SNAPBACK}>Nope, just explaining the reason why it goes wrong and to point out the fact that the function is returning a -1 ...which is not what the helpfile says. so either the Function is returning the wong value or the Helpfile needs updating... 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...
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