PDA

View Full Version : windowinstance and self closing causing "crash"



celestian
December 14th, 2020, 22:44
I am experimenting with "hypertext" links. The idea is that you use a template that will display a list of text (names of records) and then highlight the ones you're moused over. If you click on said record it will open the window associated with it. This part works.

I've configured the window in my test to "close()" if the onHover(bControl) bControl = false. This works, twice... on the third time when moving the mouse off of the opened window FGC crashes. In FGU I get the following error on the first time I do move the mouse off the record window.



[12/14/2020 4:42:34 PM] s'hyperlink_Text.lua' | s'onInit'
[12/14/2020 4:42:34 PM] s'hyperlink_Text.lua' | s'onInit' | s'datasource' | { #1 = s'.abilitynoteslist' }
[12/14/2020 4:42:34 PM] s'hyperlink_Text.lua' | s'onInit' | s'activatewindow' | { #1 = s'quicknote_hover' }
[12/14/2020 4:42:34 PM] s'hyperlink_Text.lua' | s'onInit' | s'node' | databasenode = { combattracker.list.id-00004 }
[12/14/2020 4:42:46 PM] [ERROR] MOUSE UPDATE: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.HashSet`1+Enumerator[T].MoveNext () [0x00013] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
at LEECPKFJIAJ.LMMHCENIOJI () [0x000cb] in <47f8d6a0706643a08ed500e0bc60c519>:0
at LEECPKFJIAJ.CLGFEEHEDAB () [0x00046] in <47f8d6a0706643a08ed500e0bc60c519>:0
at FG.FGDesktop.OPILCLOHJGM () [0x0002f] in <47f8d6a0706643a08ed500e0bc60c519>:0
at FG.FGDesktop.Update () [0x0004e] in <47f8d6a0706643a08ed500e0bc60c519>:0


The actual code from the script section in the opened record window:


function onHover(oncontrol)
if not oncontrol then
close();
end
end

How can I correct this problem?

Moon Wizard
December 15th, 2020, 05:58
Don't close in onHover events. I can look, but it depends on the chaining. Even in FGC, there were certain events that you couldn't close/destroy on.

Regards,
JPG

celestian
December 15th, 2020, 08:19
Don't close in onHover events. I can look, but it depends on the chaining. Even in FGC, there were certain events that you couldn't close/destroy on.

Regards,
JPG

How would you recommend closing the window if it looses focus (mouse moves off the window) ?

Moon Wizard
December 15th, 2020, 22:38
That's not really something that's supported right now. The hover system would need to be rewritten completely to account for objects disappearing in the middle. One of the problems is that hovering is a "stack of objects", since hover events are applied to multiple objects at once.

Regards,
JPG

celestian
December 15th, 2020, 23:38
Hum, shame. W/o some kludgy hackery I wouldn't be able to get around that. Would really be nice to have the ability to close a window when it's no longer needed by moving the mouse away from it. Very useful for quick popup windows.

Moon Wizard
December 15th, 2020, 23:42
That's basically what a tooltip is; so you could possibly use that if it's just simple text to show.

JPG

celestian
December 15th, 2020, 23:58
That's basically what a tooltip is; so you could possibly use that if it's just simple text to show.

JPG

I do use those when I can but my idea was to allow drag/drop from a quick popup or similar.... or formattext text.