Highlighting handles in figure

조회 수: 2 (최근 30일)
Daniel
Daniel 2014년 11월 7일
답변: Adam 2014년 11월 14일
I have a separate code with a functions, switch and cases. The purpose of this code is to play a note for every keypress (case). And I have a separate GUI which has piano tangent. So I have opened this GUI succesfully in my code by h = openfig('file.fig').
So my problem is to select a handle (piano tangent) for each case (keypress note) and highlight the handle.
But I have not found anything to solve this problem when I searched on google except handles=guihandles(object_handle). So I wrote it down in one of the case-sequences with the tagname for a tangent in the parentheses, but it stays of course unused since I must write something else to highlight the tangent.
  댓글 수: 2
Adam
Adam 2014년 11월 7일
Sorry, I'm not understanding your question here. The terminology of a piano tangent is unfamiliar to me and I'm not 100% sure what you are referring to as a handle in this case.
I assume your GUI is a static one as calling openfig will not run it as an active program, only open the last saved state of the .fig file.
Daniel
Daniel 2014년 11월 8일
I am sorry, my English is not so good, the terms I used was maybe not so specific. But I've made a piano, and by tangent I meant the pianokeys. By handles I meant each button on the GUI which I want to highlight when a note is played.
So I'll will tell it in short version:
I have created a code which is practically a piano. I press buttons and notes will play. Then I have an independent GUI that looks like a piece of piano. I want the piano keys on the GUI to highlight when I play notes. So I have to connect the code and GUI in some way. And that is my problem.

댓글을 달려면 로그인하십시오.

답변 (3개)

Image Analyst
Image Analyst 2014년 11월 8일

Daniel
Daniel 2014년 11월 14일
That does not help much.
To make my question even more simple:
How can I make a connection between a button on a GUI and a seperate code?

Adam
Adam 2014년 11월 14일
You just need to set a callback for your button and then in the callback you can call any other function or script.
Depending whether your GUI is in GUIDE or done programatically this would be done in different ways and if you want to store results from the output of your separate code then again that involves a little more work dependent on how you are creating and accessing your GUI.

카테고리

Help CenterFile Exchange에서 Just for fun에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by