Page 1 of 1

Crash: NoesisGUI-Unity-3.2.2-Indie crashes in Noesis.NoesisGUI_PINVOKE:TextBox_GetRangeBounds

Posted: 29 Dec 2023, 17:15
by Hitch1337
Basic information:
Windows 10
Unity 2022.2.19f1
NoesisGUI-Unity-3.2.2-Indie

Situation:
NoesisRootView
-> GalacticMarketView
-> Many MarketItemView
- the market item view represents a sellable item, so a row in the galactic market
- most of the time when I click on any textbox in the market item view:
- unity crashes
- the unity crash dialog opens
- it tells me it crashed at Noesis.TextBox:GetRangeBounds (see logs)
- there is nothing "fancy", just a few nested views and DataBindings, no code behind
- there seems to be a way to avoid the crash (click elsewhere, do something else before), because we once have been able to sell ingame, therefor to enter an amount in that view. We cannot recall what we did.

Reproduction:
- start the game
- switch to galatic market
- click into any of the 3 textboxes of MarketItemView in any row of the galactic market
=> crash

Attached Files:
- crashdump
- unity log
- Xaml of Market Item View
- Some screenshots for orientation

Is this related to issue2492? Is this a Noesis problem or am I doing something wrong here?

Re: Crash: NoesisGUI-Unity-3.2.2-Indie crashes in Noesis.NoesisGUI_PINVOKE:TextBox_GetRangeBounds

Posted: 02 Jan 2024, 11:25
by sfernandez
Hi, I have created issue #2980 in the tracker to follow this crash. It is not related to the one you mentioned, this is a new problem.
One question, do the TextBoxes have a template when the crash happens? because I see in the first screenshot that is using the internal debug pink templates.

Re: Crash: NoesisGUI-Unity-3.2.2-Indie crashes in Noesis.NoesisGUI_PINVOKE:TextBox_GetRangeBounds

Posted: 02 Jan 2024, 12:38
by Hitch1337
Thanks for your feedback! The issue is not a show stopper for us, but quite an obstacle in driving that Gui further. Do you see any workaround to avoid the crash and still use the TextBox? Regarding your questions: There is one Style applied to TextBox and a few properties are set directly on the TextBox, that's it, and no control templates defined. We do not have any global Xaml files yet so everything is in the Xaml file (see attachements). We are in the very early stages for prototyping the Noesis Gui.

Re: Crash: NoesisGUI-Unity-3.2.2-Indie crashes in Noesis.NoesisGUI_PINVOKE:TextBox_GetRangeBounds

Posted: 02 Jan 2024, 12:44
by Hitch1337
Btw: The first screenshot is actually ingame Noesis/Unity, the second taken from a Wpf/C# Desktop App, made in Riders Gui Designer. We are keeping the code base compatible to both Noesis/Wpf at this point.

Re: Crash: NoesisGUI-Unity-3.2.2-Indie crashes in Noesis.NoesisGUI_PINVOKE:TextBox_GetRangeBounds

Posted: 03 Jan 2024, 10:49
by sfernandez
I was able to reproduce the crash by using our internal debug templates, thanks for all the feedback, we'll fix it for the next release.

A workaround for now is to set one of our NoesisTheme files as Application Resources in the Noesis Settings (NoesisTheme.DarkBlue should be set by default) and specify in your local styles the BasedOn property so it inherits the template from the theme style:
<Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
  <Setter Property="Foreground" Value="Aqua"/>
  <Setter Property="Margin" Value="6"/>
</Style>
    
<Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
  <Setter Property="Margin" Value="6"/>
</Style>