Creating Step by Step tutorial for guide gui

I have created a GUI with GUIDE. There are several pushbuttons which execute different functions. Also I have created a menu bar button named Tutorial. Now I want to create a step by step tutorial to the Gui I have created. i.e when I press the tutorial button,a message box should appear and ask me to press one of the gui buttons. When the callback for that button is executed, the control must return to the tutorial callback and resume from where I have stopped. Is something like this possible?

 採用された回答

Matt Fig
Matt Fig 2011 年 2 月 7 日

2 投票

My first thought is that you would have to put into each callback that is used during the tutorial an IF statement, at the end of the callback, which checks whether or not the MSGBOX exists. One way to do this would be to create a TAG for the MSGBOX (or store the handle when created using GUIDATA, etc.), then use:
msg_h = findall(0,'tag','MSGTAG'); % Or extract from GUIDATA...
if ~isempty(msg_h)
figure(msg_h) % Give focus to the message box.
% Possibly update string in message box, or whatever.
end
In the body of the IF statement, you would call FIGURE to give focus to the MSGBOX and/or update the string in the MSGBOX to reflect the next set of instructions in the tutorial. Note that if you store and extract the handle to the MSGBOX, then you will have to check if it is a handle using ISHANDLE, because the user might delete it!

5 件のコメント

Sreedu
Sreedu 2011 年 2 月 8 日
Thank you for the idea. But it will be problem if the user presses 'Enter'. The msgbox will be deleted. Instead of the msgbox can I use a static text in the UI screen itself which gets updated? Then how can I use the tag?Can I update the tag of static text after each step?
Matt Fig
Matt Fig 2011 年 2 月 8 日
You could create your own message box, it is not that hard. It is just a simple little GUI: A figure with a static text big enough to carry the instructions.
Sreedu
Sreedu 2011 年 2 月 10 日
Thank you so much for the solution. It works. I have another small query. In the other callbacks the msgbox gets updated, but it appears minimised. So the user has to bring it in front to see the next instruction. How can I make it come in front? Thank you once again.
Matt Fig
Matt Fig 2011 年 2 月 10 日
You can bring it to the front by using its handle with FIGURE, like this:
figure(MSHANDLE)
Sreedu
Sreedu 2011 年 2 月 11 日
Thank you

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeInteractive Control and Callbacks についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by