Path: news.mathworks.com!not-for-mail
From: "G.A.M. " <x0zero@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Visible figure has no gui handle. Why?
Date: Wed, 29 Aug 2007 20:32:54 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 133
Message-ID: <fb4l5m$4u4$1@fred.mathworks.com>
References: <fav61d$7a5$1@fred.mathworks.com> <fav7q6$d5g$1@canopus.cc.umanitoba.ca> <fav8uo$5oc$1@fred.mathworks.com>
Reply-To: "G.A.M. " <x0zero@gmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1188419574 5060 172.30.248.38 (29 Aug 2007 20:32:54 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 29 Aug 2007 20:32:54 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1030060
Xref: news.mathworks.com comp.soft-sys.matlab:426146


Hello. I have been stumped by this problem for several days
now. Using the tips provided previously, I have been
debugging the problem. However, I still get an 'Invalid
handle' error when using get('Tag', 'figureM'). 

Below is some interesting info that shows the figure exists
and HandleVisibility = on. At the moment I execute these
statements, the figure is visible on screen. Yet I still get
an 'Invalid handle' error as shown below. Any tips? 


K>> h1 = findall(0, 'Tag', 'figureM')

h1 =

  399.0098

K>> get(h1)
	Alphamap = [ (1 by 64) double array]
	BackingStore = on
	CloseRequestFcn = closereq
	Color = [0.709804 0.807843 0.909804]
	Colormap = [ (64 by 3) double array]
	CurrentAxes = [406.01]
	CurrentCharacter = 
	CurrentObject = [32.0095]
	CurrentPoint = [230 22]
	DockControls = off
	DoubleBuffer = on
	FileName = [ (1 by 84) char array]
	FixedColors = [ (12 by 3) double array]
	IntegerHandle = off
	InvertHardcopy = on
	KeyPressFcn = [ (1 by 1) function_handle array]
	KeyReleaseFcn = 
	MenuBar = none
	MinColormap = [64]
	Name = Figure_M
	NextPlot = add
	NumberTitle = off
	PaperUnits = inches
	PaperOrientation = portrait
	PaperPosition = [0.25 2.5 8 6]
	PaperPositionMode = manual
	PaperSize = [8.5 11]
	PaperType = usletter
	Pointer = arrow
	PointerShapeCData = [ (16 by 16) double array]
	PointerShapeHotSpot = [1 1]
	Position = [72 34 1494 1031]
	Renderer = painters
	RendererMode = auto
	Resize = on
	ResizeFcn = 
	SelectionType = normal
	ShareColors = on
	ToolBar = auto
	Units = pixels
	WindowButtonDownFcn = 
	WindowButtonMotionFcn = 
	WindowButtonUpFcn = 
	WindowScrollWheelFcn = 
	WindowStyle = normal
	WVisual = 00 (RGB 32  GDI, Bitmap, Window)
	WVisualMode = auto

	BeingDeleted = off
	ButtonDownFcn = 
	Children = [ (16 by 1) double array]
	Clipping = on
	CreateFcn = 
	DeleteFcn = 
	BusyAction = queue
	HandleVisibility = on
	HitTest = on
	Interruptible = on
	Parent = [0]
	Selected = off
	SelectionHighlight = on
	Tag = figureM
	Type = figure
	UIContextMenu = []
	UserData = []
	Visible = on

K>> get('Tag', 'figureM')
??? Error using ==> get
Invalid handle.

K>> 

"G.A.M. " <x0zero@gmail.com> wrote in message
<fav8uo$5oc$1@fred.mathworks.com>...
> Hi. Thank you for your tips. I now understand a bit about
> handle visibility (and I now have some clues about what to
> search for in help).
> 
> Using the property inspector I saw that the figure's
> HandleVisibility property was set to 'callback'. I changed
> it to 'on', as advised here:
>
http://www.mathworks.cn/matlabcentral/newsreader/view_thread/155215
> 
> However, that did not change the fact that my code cannot
> find the handle. Apparently the HandleVisibility property is
>  later being set to 'off' by some process I'm not aware of.
> 
> What built-in functions would set HandleVisibility to off? I
> haven't written any code to do that, so I'm not sure why it
> is happening. I appreciate any other tips.
> 
> roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
> message <fav7q6$d5g$1@canopus.cc.umanitoba.ca>...
> > In article <fav61d$7a5$1@fred.mathworks.com>, G.A.M. 
> <x0zero@gmail.com> wrote:
> > >Hello. I have an application that creates and displays a
> > >figure (as the main window for the GUI). The figure is
> > >displayed on screen, but the gui handle doesn't exist
> > >immediately after the figure is created.
> > 
> > >Executing h=findobj shows me that the figure and all its
> > >uicontrols are not among the existing objects even though
> > >the figure is currently visible on the screen.
> > 
> > The HandleVisibility property of the figure has been set
> to 'off'.
> > 
> > See findall() and allchild()
> > -- 
> >    Okay, buzzwords only. Two syllables, tops.  -- Laurie
> Anderson
>