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: Button Up/Down Function
Replies: 8   Last Post: Apr 1, 2013 4:28 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
question on Lorenz equation

Posts: 157
Registered: 12/7/04
Re: Button Up/Down Function
Posted: Apr 1, 2013 4:28 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"mike " <miked.damianakis@gmail.com> wrote in message <hlk6fm$gf3$1@fred.mathworks.com>...
> I use this to get button-down, button-up events working:
>
> function pushbutton1_ButtonDownFcn(hObject, eventdata, handles)
> % hObject handle to pushbutton1 (see GCBO)
> % eventdata reserved - to be defined in a future version of MATLAB
> % handles structure with handles and user data (see GUIDATA)
>
> disp('down')
> set(hObject,'Value',1)



But this ButtonDownFcn will only run if you manages to hit the boarder or if you set the Enable property to 'off'... and then the normal callback wont trigger.

I would like to have Button Down/up function without disabling all my buttons...

>
> % --- Executes on mouse press over figure background, over a disabled or
> % --- inactive control, or over an axes background.
> function figure1_WindowButtonUpFcn(hObject, eventdata, handles)
> % hObject handle to figure1 (see GCBO)
> % eventdata reserved - to be defined in a future version of MATLAB
> % handles structure with handles and user data (see GUIDATA)
>
> if get(handles.pushbutton1,'Value')==1 %add more conditions here to check which %button is pushed
> disp('up')
> end
> set(handles.pushbutton1,'Value',0)




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.