Re: TreeViews in 2 different windows

new topic     » goto parent     » topic index » view thread      » older message » newer message

Rad wrote:
> 
> CChris wrote:
> > 
> > Rad wrote:
> > > 
> > > Hi,
> > > 
> > > TreeViews in 2 different windows opened simultaneously are interfering
> > > with
> > > each other.
> > > 
> > > Window1 has 2 child windows Window2 and Window3.
> > > Window2 and Window3 have separate TreeView controls TreeView43 and
> > > TreeView44
> > > respectively. 
> > > Data is being loaded for both TreeViews in their respective
> > > window_onOpen()
> > > procedures.
> > > 
> > > The first window (Window1 or Window2) to open loads TreeView data
> > > properly.
> > > If one tries to open other window while the first is still open, following
> > > error
> > > is displayed-
> > > 
> > > Error Code 495
> > > getHandle failed. 
> > > 
> > > What could be the problem?
> > > 
> > > Regards,
> > > Rad.
> > 
> > I'd need more code to understand what the problem can be, because plainly
> > creating 2 treeviews in two different child windows which are both open, and
> > 
> > loading them, doesn't seem to produce an error. I've never seen this error
> > code before, except when playing with subclassed menus with the official
> > version.
> > 
> > CChris
> 
> Sending you test program at
> christian.cuvier at agriculture.gouv.fr
> 
> Regards,
> Rad.

The following works for me:
include win32lib.ew
constant 
 w =create(Window,"aaa",0,50,50,300,300,0)
,w1=create(Window,"a1",w,10,10,150,200,WS_CHILD)
,w2=create(Window,"a2",w,180,10,150,200,WS_CHILD)
,t1=create(TreeView,"",w1,10,10,80,150,0)
,t2=create(TreeView,"",w2,10,10,80,150,0)

integer a1,a2
a1=addTVItem(t1,0,0,"Fruit1",0)
a1=addTVItem(t1,0,0,"Fruit11",a1)
a2=addTVItem(t2,0,0,"Fruit2",0)
a2=addTVItem(t2,0,0,"Fruit21",a2)

procedure p(integer id,integer event,sequence data)
openWindow(w1,Normal)
openWindow(w2,Normal)
end procedure
setHandler(w,w32HActivate,routine_id("p"))

WinMain(w,Normal)

Putting the addTVItem statements inside the w32HActivate handler works fine
too.
As you perhaps figured out, I hardly ever use the IDE.

CChris

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu