I am making a gui, but I can not make use of line 31:
set(S.canvas, 'ButtonDownFcn',{@selectedtile,S});
If I am within the newgame function it works as it should be, but in the normal way it does not. What did I make wrong? I attached the code.
Thank you

 採用された回答

Friedrich
Friedrich 2014 年 2 月 6 日

0 投票

Hi,
in line 120 you do
axis(S.canvas, 'off');
which results in the ButtonDownFcn has no effect. Try using this instead:
set(S.canvas,'Xtick',[],'Ytick',[])

5 件のコメント

Zoltán Csáti
Zoltán Csáti 2014 年 2 月 6 日
Unfortunately it does not help.
Friedrich
Friedrich 2014 年 2 月 6 日
編集済み: Friedrich 2014 年 2 月 6 日
This works fine for me in R2013b. In addition I meant in line 118 (and not 120) you do the command which breaks the ButtonDownFcn
Zoltán Csáti
Zoltán Csáti 2014 年 2 月 6 日
Yes, I realised that you meant line 118. I made a short video showing that it does not work for me. I use R2011a. What else can be wrong?
Friedrich
Friedrich 2014 年 2 月 6 日
When I set a breakpoint in the selectedtile function and click into the generated field (after doing File -> New) I get into the selectedtile function. Do you really don't get into the selectedtile function? Can you also set a BreakPoint and see if you get in.
Zoltán Csáti
Zoltán Csáti 2014 年 2 月 6 日
"When I set a breakpoint in the selectedtile function and click into the generated field (after doing File -> New) I get into the selectedtile function.". I did this before, but it didn't get into the selectedtile function. I corrected a lot of things but forgot to set a breakpoint again. Therefore - since this function does not produce any graphical changes - I didn't realise it was finally executed.
Thank you for the enlightenment.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Graphics についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by