# Window skips OPEN event

**URL:** <https://forum.xojo.com/t/window-skips-open-event/50422>\
**Category:** General\
**Created:** [September 28, 2019, 9:38pm UTC](https://forum.xojo.com/t/window-skips-open-event/50422 "2019-09-28T21:38:05Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [September 28, 2019, 11:57pm UTC](https://forum.xojo.com/t/window-skips-open-event/50422/21 "2019-09-28T23:57:00Z")

</div>

What is the type of the window?

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [September 28, 2019, 11:58pm UTC](https://forum.xojo.com/t/window-skips-open-event/50422/22 "2019-09-28T23:58:40Z")

</div>

> [@455783:@](#):
>
> What is the type of the window?

modal dialog is the one skipping the OPEN event (macOS… works fine for Windows)  
Document is the main window type

---

<div class="post-metadata">

**Author:** ![Rick\_Araujo](https://forum.xojo.com/user_avatar/forum.xojo.com/rick_araujo/32/251_2.png) [@Rick\_Araujo](https://forum.xojo.com/u/Rick_Araujo)\
**Post date:** [September 29, 2019, 12:00am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/23 "2019-09-29T00:00:08Z")

</div>

Do you have active “background” threads, or timers?

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [September 29, 2019, 12:00am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/24 "2019-09-29T00:00:37Z")

</div>

and you open it on a button press, not something like a double click of a listbox ?

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [September 29, 2019, 12:05am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/25 "2019-09-29T00:05:48Z")

</div>

> [@455786:@](#):
>
> and you open it on a button press, not something like a double click of a listbox ?

no timers, no threads, no dbl-click listbox

Hoping the the exception that the 32bit compile throws would be a clue?

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [September 29, 2019, 12:07am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/26 "2019-09-29T00:07:46Z")

</div>

> [@455787:@Dave S](#):
>
> Hoping the the exception that the 32bit compile throws would be a clue?

Did I miss that somewhere? Has the post been removed?

---

<div class="post-metadata">

**Author:** ![Rick\_Araujo](https://forum.xojo.com/user_avatar/forum.xojo.com/rick_araujo/32/251_2.png) [@Rick\_Araujo](https://forum.xojo.com/u/Rick_Araujo)\
**Post date:** [September 29, 2019, 12:08am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/27 "2019-09-29T00:08:06Z")

</div>

I had a hell to track an issue once, because a window had used a custom component, multiple times, and it started to fire a cascade of events out of order, breaking points got insane. Just adding more inspiration for your search. 😃

---

<div class="post-metadata">

**Author:** ![Rick\_Araujo](https://forum.xojo.com/user_avatar/forum.xojo.com/rick_araujo/32/251_2.png) [@Rick\_Araujo](https://forum.xojo.com/u/Rick_Araujo)\
**Post date:** [September 29, 2019, 12:10am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/28 "2019-09-29T00:10:23Z")

</div>

Oh. I see an edit. [https://forum.xojo.com/conversation/post/455782](https://forum.xojo.com/conversation/post/455782)

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [September 29, 2019, 12:11am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/29 "2019-09-29T00:11:42Z")

</div>

> [@455790:@Rick Araujo](#):
>
> Oh. I see an edit. [https://forum.xojo.com/conversation/post/455782](https://forum.xojo.com/conversation/post/455782)

???

---

<div class="post-metadata">

**Author:** ![Rick\_Araujo](https://forum.xojo.com/user_avatar/forum.xojo.com/rick_araujo/32/251_2.png) [@Rick\_Araujo](https://forum.xojo.com/u/Rick_Araujo)\
**Post date:** [September 29, 2019, 12:12am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/30 "2019-09-29T00:12:56Z")

</div>

> [@455791:@Dave S](#):
>
> ???

The “exception” Julian and myself did not see.

---

<div class="post-metadata">

**Author:** ![Rick\_Araujo](https://forum.xojo.com/user_avatar/forum.xojo.com/rick_araujo/32/251_2.png) [@Rick\_Araujo](https://forum.xojo.com/u/Rick_Araujo)\
**Post date:** [September 29, 2019, 12:18am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/31 "2019-09-29T00:18:13Z")

</div>

I don’t know. Who knows you reached uncharted waters in the compilers, 32 bit exploded and 64 bit got silently crazy. You may need the engineers looking at it.

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [September 29, 2019, 12:18am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/32 "2019-09-29T00:18:25Z")

</div>

Wasn’t there a stack trace posted in here? Or was I dreaming that from another thread I was looking at?

> [@455772:@Dave S](#):
>
> There is a method that is being called

Rename this method and see what issues that causes.

Check your paints for recursion.

Clutching at straws now 😉

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [September 29, 2019, 12:21am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/33 "2019-09-29T00:21:18Z")

</div>

That exception (32 bit) is somewhere in here

```auto
// without this, TextArea updates colors without waiting for SelectColor to finish
#If TargetCocoa Then
  Dim dummy As String
  
  Declare Function documentView Lib "Cocoa" selector "documentView" ( obj As Integer ) As Integer
  Declare Sub mysetUsesFontPanel Lib "Cocoa" selector "setUsesFontPanel:" ( obj As Integer, flag As Boolean )
  Dim myTextArea As Integer = documentView(Self.Handle)
  
  mysetUsesFontPanel(myTextArea, False )
  //
  //
  //
  Declare Function NSClassFromString Lib "Cocoa" (aClassName As CFStringRef) As Ptr
  
  Declare Sub setAutomaticQuoteSubstitutionEnabled Lib "Cocoa" selector "setAutomaticQuoteSubstitutionEnabled:" (id As ptr, value As Boolean)
  Declare Sub setAutomaticDashSubstitutionEnabled Lib "Cocoa" selector "setAutomaticDashSubstitutionEnabled:" (id As ptr, value As Boolean)
  Declare Sub setAutomaticTextReplacementEnabled Lib "Cocoa" selector "setAutomaticTextReplacementEnabled:" (id As ptr, value As Boolean)
  
  Dim value As Boolean=False
  Dim pntr As ptr = ptr(myTextArea)
  
  setAutomaticQuoteSubstitutionEnabled(pntr, value)
  setAutomaticDashSubstitutionEnabled(pntr, value)
  setAutomaticTextReplacementEnabled(pntr, value)
  
#EndIf
```

as a matter of fact is seems THE WHOLE PROBLEM is in there somewhere…  
I don’t execute that code… .and everything closes and opens properly in both 32bit AND 64bit!!!

---

<div class="post-metadata">

**Author:** ![Rick\_Araujo](https://forum.xojo.com/user_avatar/forum.xojo.com/rick_araujo/32/251_2.png) [@Rick\_Araujo](https://forum.xojo.com/u/Rick_Araujo)\
**Post date:** [September 29, 2019, 12:25am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/34 "2019-09-29T00:25:00Z")

</div>

Oh boy. Uncharted human made waters. 😃

---

<div class="post-metadata">

**Author:** ![Rick\_Araujo](https://forum.xojo.com/user_avatar/forum.xojo.com/rick_araujo/32/251_2.png) [@Rick\_Araujo](https://forum.xojo.com/u/Rick_Araujo)\
**Post date:** [September 29, 2019, 12:27am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/35 "2019-09-29T00:27:44Z")

</div>

Well, seems you are isolating the problem. Can you turn such customization off for a test?

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [September 29, 2019, 12:33am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/36 "2019-09-29T00:33:26Z")

</div>

I THINK I FOUND IT!!! (hoping)

seems that

```auto
 Dim myTextArea As Integer = documentView(Self.Handle)
```

needed to be

```auto
 Dim myTextArea As Integer = documentView(ME.Handle)
```

the text area was in a container, and SELF was the container not the text area

So who knows what those declares were doing with that wrong Address!

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [September 29, 2019, 12:36am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/37 "2019-09-29T00:36:18Z")

</div>

Glad you got to the bottom of it.

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [September 29, 2019, 12:36am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/38 "2019-09-29T00:36:20Z")

</div>

and OPEN works properly…

Thanks for everyones support…

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [September 29, 2019, 12:37am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/39 "2019-09-29T00:37:09Z")

</div>

Out of interest, where was that code called from?

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [September 29, 2019, 12:43am UTC](https://forum.xojo.com/t/window-skips-open-event/50422/40 "2019-09-29T00:43:40Z")

</div>

in the TextArea open where the TextArea was on the main Window (on a pagepanel)

So it got called very early in the app initialization, and I guess mucked up pointers behind the scenes making various window events no long function. just changing that ONE WORD… fixed all the issues at once

[Previous page](https://forum.xojo.com/t/window-skips-open-event/50422.md?page=1)

[Next page](https://forum.xojo.com/t/window-skips-open-event/50422.md?page=3)
