필터 지우기
필터 지우기

Copying from GUI listbox to Matlab Desktop

조회 수: 1 (최근 30일)
Daniel
Daniel 2011년 11월 8일
Hi,
is there a way to copy (selected) elements listed in a listbox GUI to the buffer (Ctrl-C,etc) and from there to the editor, desktop, or even to sytem?
I was not able to figure out which option of the object would enable this behavior, and I guess there should be possible (as other elements in GUI can get cut and pasted...)
thansk in advance, Daniel

채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 11월 8일
Are you asking about doing it in code or doing it interactively when you edit the GUI elements?
You can use clipboard() to implement the copy-and-paste functionality in the code. If doing it interactively, you need to edit the property of the listbox and the Ctrl+c and Ctrl+v.

추가 답변 (2개)

Walter Roberson
Walter Roberson 2011년 11월 8일
There is no MATLAB option to enable or disable this. Whether it would work or not would operating system dependent.
You can have the callback for the listbox detect the current Value, and extract the String rows corresponding to the selected elements, and then do something with them. This would require "activating" the listbox, though.

Daniel
Daniel 2011년 11월 8일
thanks to both of you: clipboard() is exactly what I needed. And the "activation" with Callback the part that I hadn't understood at first.
Now it's working fine... thanks!

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by