Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

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 ]
Kristin

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$1@newscl01ah.mathworks.com>...
> 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:
initial_val=0;
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);
end

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


Date Subject Author
11/27/12
Read GUI slider
Veneree
12/7/12
Read Re: GUI slider
Kristin
12/8/12
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]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.