Highlighting handles in figure

2 Ansichten (letzte 30 Tage)
Daniel
Daniel am 7 Nov. 2014
Beantwortet: Adam am 14 Nov. 2014
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 Kommentare
Adam
Adam am 7 Nov. 2014
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 am 8 Nov. 2014
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.

Melden Sie sich an, um zu kommentieren.

Antworten (3)

Image Analyst
Image Analyst am 8 Nov. 2014

Daniel
Daniel am 14 Nov. 2014
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 am 14 Nov. 2014
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.

Kategorien

Mehr zu Just for fun finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by