The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: cla clearing handles from the wrong axis
Replies: 9   Last Post: Feb 25, 2013 4:01 PM

Advanced Search

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

Posts: 16
Registered: 10/31/12
cla clearing handles from the wrong axis
Posted: Feb 24, 2013 2:29 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have a GUI for an image stack and the main axis has patches on it. These handles to these are stored in an array: myData.mainGUIWindowGraphicsHandles()
In some situations, the user clicks on one of these patches and a new figure window pops up which allows the user to look at that region of the image stack in more detail. This figure has its own axis and it also has its own patch objects. Furthermore, the function that draws the second figure also puts some rectangles on the main Gui Window. These extra rectangles have as a parent the mainGUIWindow axis, but the handles are stored in the guidata object for the 2nd window.

So the situation is: 2 figures, an axis on each, one triggered by a mouse click on the other. Patches on both.

The 2nd figure is actually made at the start of the entire GUI but it is just set to Visibility=off and HitTest=off. When it is triggered, I set these to on. However, each time I use it I want to reset the graphics - removing the previous graphics completely.

I have the command: cla(SecondFigureAxis,'reset')

When I do this, it does exactly what it is supposed to do for the second figure, but it also, somehow, changes the array of patch handles for the main GUI window too. Suddenly, many of them are no longer valid handles which messes up downstream GUI functions. (before, a call to ishandle for the handles array gives all 1s. After, there are strings of 0s).

I have traced the problem to the cla() line, but can't figure out why it would do this and how to fix it. I'd be happy to share the code and dependencies, an input file, and instructions on how to get the error if someone could help me.

Thanks much for any help.

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.