Chai_Ren
(Chai Ren)
June 10, 2017, 8:25am
1
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
Chai_Ren
(Chai Ren)
June 10, 2017, 8:52am
3
why? dim x2 as window1 will clone a new obj? what I want just a pointer.
Chai_Ren
(Chai Ren)
June 10, 2017, 8:57am
4
directly use dictmap.value(“test”).show will show error as could not use “show” method in “Auto” type
Window1(dictmap.value("test")).show
Tim_Hare
(Tim Hare)
June 10, 2017, 5:53pm
7
[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.
Chai_Ren
(Chai Ren)
June 11, 2017, 10:40am
8
[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
Tim_Hare
(Tim Hare)
June 11, 2017, 6:29pm
9
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")
Chai_Ren
(Chai Ren)
June 12, 2017, 9:36am
10
[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…
Tim_Hare
(Tim Hare)
June 12, 2017, 8:32pm
11
Can you post a small project that demonstrates the problem?
Chai_Ren
(Chai Ren)
July 7, 2017, 3:24am
12
thanks I resolve it… but I don’t know why -___-