Why figure toolbar doesn't work in GUI

I have created figure toolbar in GUIDE with toolbar editor, and put some usual stuff, zoom in, out, pan, data cursor and print.
And nothing of those seems to work. Why? And when I run GUI it let me turn on more functions at once?!
Thanks.

6 Comments

  • Did you add anything to the callbacks?
  • Do you have an axes with plotted stuff on it?
GUIDE issues are hard to diagnose since we can't see the files.
Yes I have plenty of stuff in GUI. But in the callbacks of toolbar functions nothing
I have 4 axes right on the start of gui. And some buttons...
Ok, can I turn on the whole default figure toolbar on startup?
Thanks.
I suppose you explicitly turn on the toolbar, yes.
set(handles.figure1,'toolbar','figure');
But it should work pretty much out of the box if you do it from the GUIDE Editor. Feel free to send me the figure/code, you've piqued my curiosity.
Hehe, i know it's interesting.
So just to be clear i put the code under varargout function?
Thanks.
Huh?
I would put it in the myGUI_outputfcn but once again I'd be more curious to find the root cause of it not working in the first place...
Its a lot of code - 866 lines. It is hard to figure out in some dicent time. And I need quick answer. Sry.
Nothing seems to work.
Only when i type: set(gcf,'toolbar','figure');
but then I get, besides what I wanted, an empty figure with toolbar...
Thanks.

Sign in to comment.

 Accepted Answer

put this code in your openingFCN function
set(gcf,'toolbar','figure');

4 Comments

Nope. Didnt work. Something is wrong with my GUI.
I have created new small gui and it works. On this big one doesn't.
Thanks anyway.
Works. Haha, it was problem of physical nature. It just wasn't room for toolbar. I have expanded the gui workspace and it is ok now.
Thank you all.
Could you clarify what you did? I am having the exact same problem. I have less than 300 lines of code though.
Worked perfectly for me, thanks!

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!