Is this a bug? Window Opening not firing Open Event

I have a window which when opening is not firing the Open event. It was but now it is not.

I have even added the breakpoints shown in the image below. The app just runs and misses the breakpoints and does not execute any of the code within the open event.

Perhaps lack of caffeine and sleep I am missing the obvious but what is going on here?

Xojo 2014 r2
Mac OSX 10.9.4

The image doesn’t appear so I can’t really say, but are you subclassing the window?

Bob sorry, can you see this? No I am not subclassing the window.

I can see it now.

Do me a favor. Restart your computer and see if that fixes the issue. It’s my batshit crazy fix that will sometimes clear up what looks to be crazy stuff like this.

I beat you to it. Just tried that but no. Still not firing

Clear the plugin cache too?

How do i do that?

And I guess the other question is there a difference between Cocoa and Carbon? Carbon has had a few regressions in R2.

Its a cocoa build

Delete ~user/Library/Caches/Xojo and restart Xojo although I’ve had times where I’ve had to restart the computer.

Any difference if doing Carbon?

Deleted the cache, no change. It won’t run under carbon without changes because of other areas of the app.

Well, I don’t know what to tell you. I was working in the Window.Open event just a few minutes ago in a Cocoa app.

Time to shut the computer down and go have a drink, or four, and come back tomorrow?

[quote=115918:@Bob Keeney]Well, I don’t know what to tell you. I was working in the Window.Open event just a few minutes ago in a Cocoa app.

Time to shut the computer down and go have a drink, or four, and come back tomorrow?[/quote]

I think it is… :slight_smile: Completely baffled by this, never had this issue before and it was firing the open event earlier today. I can’t see how it can not fire. I might just try profiling the code and see if it appears there.

No nothing being profiled either… Odd. My other windows in the same app are firing open events?

You don’t have something else defined on there named Open do you ?
I’d expect a different error

Its not a subclass and the parent isn’t raising the Open event is it ?

This is a silly question…did you happen to copy frmMain and set its copy to be the default window, so you’re changing code in a window that isn’t actually used?

Right, I have found the issue but I don’t understand why it is causing it. I have a container control instance on the window on which there is a combo box. In the combo box open event I have the following code:

for N as integer = 0 to FontCount me.AddRow(Font(n)) next N

For whatever reason, if I comment this code out, the open event of the window fires correctly and the methods listed on my image above fire.

Further to this, I realised that I should be iterating through the fonts to FontCount -1 so I changed the above code as such and everything is ok. Very odd that the above mistake would stop the open event firing but continue execution normally.

Can anyone explain this?

Quickly verified it - indeed it prevents all Open events, which would be called after the the ComboBox’s Open event (which includes other controls, the ContainerControl itself and the window).

The bug can be verified as follows:

Dim fontName As String = Font(FontCount)

This should give an OutOfBoundsException, but it doesn’t - in the debugger the app just pauses for a second and then continues to run.

Tested on Cocoa with v2014 r2. A test with the RB 2012 shows that the bug was not present at that time.

That’s a vicious bug. Mike, you should file a report with a test project demonstrating. It needs fixing.