Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: gui, playing with figures
Replies: 6   Last Post: Sep 9, 2009 4:52 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
John

Posts: 17
Registered: 7/8/07
Re: gui, playing with figures
Posted: Sep 9, 2009 3:53 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Matt Fig" <spamanon@yahoo.com> wrote in message <h861q7$so8$1@fred.mathworks.com>...
> Your code could be modified this way to do what you want:
>
> function [] = mygui()
>
> S.fh = figure('units','pixels',...
> 'position',[500 500 350 50],...
> 'menubar','none',...
> 'numbertitle','off',...
> 'name','GUI_20',...
> 'resize','off');
> S.ed = uicontrol('style','edit',...
> 'units','pixels',...
> 'position',[10 10 220 30],...
> 'fontsize',14,...
> 'string','Enter Title');
> S.pb = uicontrol('style','push',...
> 'units','pixels',...
> 'position',[240 10 100 30],...
> 'fonts',14,...
> 'str','creat figure',...
> 'callback',{@pb_call,S});
>
> function [] = pb_call(varargin)
> L = length(S.fh);
> S.fh(L+1) = figure('windowbuttondownfcn',{@fh_wbdfcn},...
> 'deletefcn',{@fh_dfcn});
> plot(rand(10,1));
> S.T{L+1} = get(S.ed,'String');
> title(S.T(L+1));
> S.fh
> end
>
> function [] = fh_wbdfcn(varargin)
> set(S.ed,'string',S.T{S.fh(S.fh==varargin{1})})
> end
>
> function [] = fh_dfcn(varargin)
> S.fh(S.fh==varargin{1}) = [];
> end
>
> end
>
>
>
>
>
> Note I will leave the commenting up to you!


Thanks for you advice but I have already tried to use windowbuttondownfcn problem is that it is called only when user click inside figure but you can get figure in frond just by clicking on edge of window or by some other way and windowbuttondownfcn doesn&#8217;t realize that :( . So I am still looking for another way how to do it.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.