f



GUI question - don't want rmappdata called, but don't want to use uiwait

I am writing an application with multiple windows. I want
the main window to open first. Then I want the user to be
able to interact with this main window (via uicontrols). I
want plots to be drawn in this main window, etc. Sometimes
dialogs and other windows will be opened, but the main
window should always remain open. I think this is the
default behavior...

When I try to run my program, the figure's OpeningFcn is
called, initialize_gui is called, the main gui window is
created and displayed and my uicontrols work. But, rmappdata
in gui_mainfcn is immediately called and the handle to my
main window is removed at that point. When my m-files call
findobj('Tag', 'tag_my_main_window') the resulting handle is
empty. When I execute h = findobj in the workspace, my main
window and all its controls are not among the handles returned. 

My code fails because it cannot obtain a handle to my main
window for plotting or anything else.

Does anyone have an idea where I'm going wrong? This is in
r2007a.

Thank you
0
x0zero (90)
8/27/2007 6:00:46 PM
comp.soft-sys.matlab 211265 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

2 Replies
645 Views

Similar Articles

[PageSpeed] 59

I would guess that the figure's HandleVisibility is set to
'Callback' - as a quick solution you could simply set it to
'on' so callback functions for other figures are able to see it.
0
dgambleDEL (52)
8/27/2007 6:42:03 PM
Darik - thanks for your reply. You were correct about the
HandleVisibility setting. I changed it to 'on'. However,
after doing this I get the following error:

??? Error using ==> set
uipanel handle passed to 'CurrentFigure' property - valid
figure handle required

When I step through my code, I can check the validity of the
figure's handle in the workspace. I'm not sure if this is
the best debugging technique. However, what I find this way
is that the handle becomes invalid as soon as the figure's
initialization is complete.

When I click on a uicontrol in the figure, the code to
initialize is called all over again. I would have expected
the figure to be initialized once -- unless it is closed. I
would also have expected the figure's handle to remain valid
unless the figure is closed or deleted.

I have no idea why the figure's handle becomes invalid at
the conclusion of initialization. Thanks.

FYI, I posted a related question here:
http://www.mathworks.cn/matlabcentral/newsreader/view_thread/155216


"Darik " <dgambleDEL@uwaterlooDEL.caDEL> wrote in message
<fav5tr$4ur$1@fred.mathworks.com>...
> I would guess that the figure's HandleVisibility is set to
> 'Callback' - as a quick solution you could simply set it to
> 'on' so callback functions for other figures are able to
see it.

0
x0zero (90)
8/27/2007 7:22:20 PM
Reply: