Re: Control user change of SpinButton value



What I need is to know if the change on a spinbutton has been solicited by the user or by the code. If the change has been done by the user I need to execute some extra function that don't have to be
executed if the change has been done by the code.
If that is all you need, then you can create a status variable in your derived window class that defaults to false (meaning the user is changing the spin button object's value). Then when your code would change the spin button object's value, set the status variable to true before making the change. Then, in the callback slot, if the status variable is false you call your extra function (for when the user has changed the value) else if the status variable is true (meaning your code has changed the value) you reset the status variable's value back to false without running your extra function.

Bob Caryl




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]