File Exchange

image thumbnail

Drag Line in GUI

version 1.0 (6.73 KB) by

Lines in the GUI can be dragged

6 Downloads

Updated

View License

run DragLineGUI.m

This demo is modeled after Doug Hull excellent demo @:
http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/
but has been revised to work in a file created with GUIDE.
The two lines can be dragged with the mouse and the positions can be passed to the command window by pressing the push button.
It also shows how to pass the GUI handles to the user defined callback functions in the same way GUIDE does.

Comments and Ratings (3)

I have a problem, i need drag a line in a GUI but using uipanel instead of axis. . .
The name 'WindowButtonUpFcn' is not an accessible property for an instance of
class 'uicontrol'.

I changed .axes1 for .uipanel1

Error in interfazAnotacion>slider1_Callback (line 430)
set(hObject, 'WindowButtonUpFcn',
@(hObject,eventdata)interfazAnotacion('stopDragFcn',hObject,eventdata,guidata(hObject)));

polaris

Thank You Gero Nootz, This is the thing I was looking for :)

MATLAB Release
MATLAB 7.12 (R2011a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

DragLineGUI/