reshow a window bugs

dim x1 as window1

dim dictmap as new xojo.core.dictionary.
dictmap.value(“test”,x1)

and the follow code would open a new window

if dictmap.haskey(“test”) then
dim x2 as window1 = dictmap.value(“test”)
x2.show
end if

x2 should not the same with x1 in my opinion.

I just want to show the exist window. not the open twice.

if dictmap.haskey("test") then dictmap.value("test").show end if

why? dim x2 as window1 will clone a new obj? what I want just a pointer.

directly use dictmap.value(“test”).show will show error as could not use “show” method in “Auto” type

Window1(dictmap.value("test")).show

works…thanks

[quote=335401:@Chai Ren]if dictmap.haskey(“test”) then
dim x2 as window1 = dictmap.value(“test”)
x2.show
end if[/quote]
x2 is the same as x1. It does not create a new window. It shows the previously created one.

No, it does not create a new object. It is just a pointer.

[quote=335437:@Tim Hare]x2 is the same as x1. It does not create a new window. It shows the previously created one.

No, it does not create a new object. It is just a pointer.[/quote]

but I don’t know. when I do that, a new window will created and showed. the same with the previous

Is that your exact code? The code you posted will not create a new window.

dim x2 as window1 = dictmap.value("test")
x2.show

Is exactly the same as

Window1(dictmap.value("test")).show

Are you sure you’re not doing something like

dim x2 as new window1 = dictmap.value("test")

[quote=335583:@Tim Hare]Is that your exact code? The code you posted will not create a new window.

dim x2 as window1 = dictmap.value("test")
x2.show

Is exactly the same as

Window1(dictmap.value("test")).show

Are you sure you’re not doing something like

dim x2 as new window1 = dictmap.value("test") [/quote]

no I am sure…

Can you post a small project that demonstrates the problem?

thanks I resolve it… but I don’t know why -___-