BlueDragonBall Posted August 5, 2007 Share Posted August 5, 2007 I want to know if it is possible to call a function each time the text in an input box change... And, is it possible to do the same thing with radiobutton? Every time it is checked and unchecked... Thanks to all! Link to comment Share on other sites More sharing options...
MHz Posted August 5, 2007 Share Posted August 5, 2007 Use GuiCtrlRead() within your loop to constantly check the controls of interest. Link to comment Share on other sites More sharing options...
BlueDragonBall Posted August 5, 2007 Author Share Posted August 5, 2007 How can I make this? But my question is: is there a function like GUIGetMsg() for Gui controls? Link to comment Share on other sites More sharing options...
Generator Posted August 5, 2007 Share Posted August 5, 2007 You can use OnEventMode, which i perfer, Opt("GUIOnEventMode",1) Then you can GUICtrlSetOnEvent() Which will notefiy the script once the button is checked or unchecked. Link to comment Share on other sites More sharing options...
MHz Posted August 5, 2007 Share Posted August 5, 2007 Perhaps this gives you the idea of concept. GUICreate('Example') GUICtrlCreateLabel('type: hello', 5, 5) $input_1 = GUICtrlCreateInput('', 5, 20, 100) GUISetState() While 1 $input = GUICtrlRead($input_1) Switch GUIGetMsg() Case -3 Exit EndSwitch Select Case $input = '' ContinueLoop Case $input = 'hello' _Function() EndSelect WEnd Func _Function() GUICtrlSetData($input_1, 'hello world') EndFunc Link to comment Share on other sites More sharing options...
BlueDragonBall Posted August 5, 2007 Author Share Posted August 5, 2007 Yes, I understand, but with this method, the function is in loop! And, I want a method to run the function one time! Link to comment Share on other sites More sharing options...
Generator Posted August 5, 2007 Share Posted August 5, 2007 You will have to put the func in a loop if you want to detect an inputbox's text has changed in RealTime. Link to comment Share on other sites More sharing options...
MHz Posted August 5, 2007 Share Posted August 5, 2007 (edited) Yes, I understand, but with this method, the function is in loop! And, I want a method to run the function one time!Just use a condition. GUICreate('Example') GUICtrlCreateLabel('type: hello', 5, 5) $input_1 = GUICtrlCreateInput('', 5, 20, 100) GUISetState() Global $detect = True While 1 If $detect Then $input = GUICtrlRead($input_1) EndIf Switch GUIGetMsg() Case -3 Exit EndSwitch Select Case $input = '' ContinueLoop Case $input = 'hello ' $detect = False $input = '' _Function() EndSelect WEnd Func _Function() GUICtrlSetData($input_1, 'hello world') EndFunc Edit: Added a variable reset to '' Edited August 5, 2007 by MHz 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