The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: GUI slider
Replies: 2   Last Post: Dec 8, 2012 11:28 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 69
Registered: 2/22/12
Re: GUI slider
Posted: Dec 7, 2012 8:26 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Veneree" wrote in message <k92rqa$59c$>...
> Hi,
> I would like to check if the slider has been moved or not in a GUI. How could I do that?
> Thanks

% initialize the slider with some data in the UserData property:
set(slider_handle, 'Value', initial_val);
set(slider_handle, 'UserData', initial_val);

% Check on the value
new_val = get(slider_handle, 'Value');
old_val = get(slider_handle, 'UserData');
if old_val == new_val
set(slider_handle, 'UserData', new_val);

Or i guess you can use persistent variables, but I do not much about them.

Date Subject Author
Read GUI slider
Read Re: GUI slider
Read Re: GUI slider
Yair Altman

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.