BlueDragonBall Posted August 5, 2007 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!
MHz Posted August 5, 2007 Posted August 5, 2007 Use GuiCtrlRead() within your loop to constantly check the controls of interest.
BlueDragonBall Posted August 5, 2007 Author Posted August 5, 2007 How can I make this? But my question is: is there a function like GUIGetMsg() for Gui controls?
Generator Posted August 5, 2007 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.
MHz Posted August 5, 2007 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
BlueDragonBall Posted August 5, 2007 Author 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!
Generator Posted August 5, 2007 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.
MHz Posted August 5, 2007 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
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