quick_sliver007 Posted February 27, 2005 Posted February 27, 2005 How do I check to see if a ctrl is used in a Gui? What I want to do is check if a menu item is clicked. like this.... Func _checkmenuitemsave() If menu item is clicked = true then do this EndIf EndFunc case $msg = $exit Call("_checkmenuitemsave") Exitloop I want to check if the menu item save is clicked any time while the program is runing, so that it does something on exit if it was clicked. Please help. .
phillip123adams Posted February 27, 2005 Posted February 27, 2005 One way is when the menu item is clicked, trap it in the while loop and set a variable accordingly. Later, when exiting the script, check the current value of the variable to decide what steps to take. For another method, see the example in the help file for GUICtrlCreateMenuitem and look at what is done for the menu item $viewstatusitem. Phillip
quick_sliver007 Posted February 27, 2005 Author Posted February 27, 2005 One way is when the menu item is clicked, trap it in the while loop and set a variable accordingly. Later, when exiting the script, check the current value of the variable to decide what steps to take.For another method, see the example in the help file for GUICtrlCreateMenuitem and look at what is done for the menu item $viewstatusitem.<{POST_SNAPBACK}>I have no ideal how to trap it and I don't think the otherway would work. But, I just had an ideal,case msg = $saveiniwrite 1 to some where on character inicase msg = $exit$var = iniread where that 1 isIf $var = 1 then do thisElsedo otherend ifexitloopI think will try it tomorrow. All of this programing is cutting in on my sleep.Thank you Phil, for being most helpful. .
phillip123adams Posted February 28, 2005 Posted February 28, 2005 I have no ideal how to trap it and I don't think the otherway would work. But, I just had an ideal,<{POST_SNAPBACK}>By "trap", I meant to assign the menu buttons to a variable, then in the While loop, check the value of $msg in the Select statement. If it's a menu button, assign a value to a variable so that later you will know it was clicked. Phillip
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