Any way to force a refresh of EventHandler list?

Often times In the IDE, if you have an instance of a class in a window (for example) and then you create a new Event Definition for the class, that event will not appear in the list when attempting to create a new Event Handler for the instance.

I’ve found the best way to fix this is just close & reopen the project. The problem is some projects are huge, and with loading and the first build this ends up taking ~10 minutes to do.

Is there any way to force a refresh of the cached event handler list for instances of classes?

To the right of the “Contents” label in the Navigator there’s Hide (hover your mouse over the right of the navigator). Click on Hide then on Show this will reset the navigator view. Does it fix your problem?

Usually just saving the project will fix this.

It’s not an issue in the navigator view, it’s in the sheet window that lets you create a new event handler for a control.

This doesn’t seem to have any effect. I tried deleting an event definition to see if that would trigger a reload of the available events, but it did not (and the deleted definition still appears).

I created a sample project/screencast to reproduce this, but your workaround of saving the project seems to work to reload the available event handlers.

However that still isn’t not working in one of my larger projects – I still need to close/reopen the project. Strange.

Ah - that’s the OSX issue that pushed me back to Windows. Thom elsewhere mentioned clicking 3 other places (controls windows?) which would force the cache to refresh.

This one isn’t “OS X only” - its on all versions on all platforms
I know what’s wrong its just not straight forward to refactor the code that does the refresh out in a way that it can be used in spots other than the reload of the window
Which is why it remains as is
And there are some other gotchas to it beyond the event definitions

Never bumped into it on Windows though.

Dumb luck :slight_smile:

Is there a case report for this as I think I just figured out how to fix this (dumb luck when looking to fix something else)

Don’t think so, I didn’t create a case for it and nothing shows up in a quick search.

I did find one #30370

I am about 50%/50% on save working for me.

[quote=112343:@Norman Palardy]This one isn’t “OS X only” - its on all versions on all platforms
I know what’s wrong its just not straight forward to refactor the code that does the refresh out in a way that it can be used in spots other than the reload of the window
Which is why it remains as is
And there are some other gotchas to it beyond the event definitions[/quote]

sounds really complicated to get fixed… so Norm will have it done by Beer-oclock tonight, right? :wink:

I am just kidding. Is this something we can see a fix for or just deal with the issue? I am just trying to get my expectations level set.

thanks!

<https://xojo.com/issue/30370>

I just came across what appears to be a slightly different variant of this bug, but this one doesn’t seem to have a work around.

I have a “Histogram” container control class that has a “LevelsChanged” event definition. When I started work on the class, the event only had a single parameter (Channel As Integer). I need to add another parameter to the event definition LevelsChanged(Index As Integer, Channel As Integer), but when I do, the new parameters do not ever show in the event hander code. No amount of closing, re-opening the project will get the new parameters to appear as parameters of the event handler.

Its not quite the same bug despite outward appearances.
It’s not the “same” event any more
The one you implemented had different parameters and the noes one has a different signature & we won’t just update it automagically.
Try adding the revised event - I don’t recall off the top of my head if that looks at the whole signature or just the name and I don’t have the sources open at this second.
If it won’t copy the code, remove the handler & and add it again and paste your code back in.

I tried deleting the event declaration and then adding it again with the same name, and still no love.

not the definition

the implementation

copy all the code in the event handler
delete the event handler
add it back & paste your code

I’ve done both Norman. I’ve even tried deleting everything (event declaration and event hander), saving, closing, re-opening the project and then re-adding everything back in with the new parameter. Still only ever displays the old ones (in the event handler - obviously the declaration is fine).

A report with a video or really detailed steps about your set up would be awesome as then I could maybe duplicate the issue & fix it

For me videos tend to work really nicely because there’s always some little detail that they show that isn’t listed in the reported steps