Unexpected difference between ListView and FrameView
See original GitHub issueopen System
open NStack
open Terminal.Gui
let ustr (str: string) = ustring.op_Implicit str
let createApplication() =
Application.Init()
let top = Application.Top
let window = new Window(
X = Pos.At 0,
Y = Pos.At 0,
Width = Dim.Fill(),
Height = Dim.Fill()
)
// same settings
let keysFrameView = new FrameView(ustr "Keys",
X = Pos.Left window,
Y = Pos.Bottom window,
Width = Dim.Fill(),
Height = Dim.Percent(50.f)
)
// same settings
let keysListView = new ListView(
X = Pos.Left window,
Y = Pos.Bottom window,
Width = Dim.Fill(),
Height = Dim.Percent(50.f)
)
keysListView.SetSource([|
for _ = 0 to 32 do
ustr (Guid.NewGuid().ToString())
|])
window.Add keysListView // works
// window.Add keysFrameView // comment prev, uncomment this -> doesn't work
top.Add window
Application.Run top
createApplication()
When adding listView everything works as expected When adding frameView instead I get an exception (I modified it to show both edges instead of only one for clarity):
Unhandled exception. System.InvalidOperationException: TopologicalSort (for Pos/Dim) cannot find link from Window()({X=0,Y=0,Width=80,Height=1}) to FrameView()({X=0,Y=0,Width=0,Height=0}). Did you forget
to add it to ContentView()({X=1,Y=1,Width=78,Height=0})?
at Terminal.Gui.View.TopologicalSort(HashSet1 nodes, HashSet
1 edges) in H:\source\repos\En3Tho\gui.cs\Terminal.Gui\Core\View.cs:line 1875
at Terminal.Gui.View.LayoutSubviews() in H:\source\repos\En3Tho\gui.cs\Terminal.Gui\Core\View.cs:line 2011
at Terminal.Gui.View.LayoutSubviews() in H:\source\repos\En3Tho\gui.cs\Terminal.Gui\Core\View.cs:line 2018
at Terminal.Gui.View.LayoutSubviews() in H:\source\repos\En3Tho\gui.cs\Terminal.Gui\Core\View.cs:line 2018
at Terminal.Gui.Application.Begin(Toplevel toplevel) in H:\source\repos\En3Tho\gui.cs\Terminal.Gui\Core\Application.cs:line 733
at Terminal.Gui.Application.Run(Toplevel view, Func`2 errorHandler) in H:\source\repos\En3Tho\gui.cs\Terminal.Gui\Core\Application.cs:line 1032
at Program.createApplication() in H:\source\repos\En3Tho\gui.cs\FSharpExample3\Program.fs:line 41
at <StartupCode$FSharpExample3>.$Program.main@() in H:\source\repos\En3Tho\gui.cs\FSharpExample3\Program.fs:line 43
Is there something I miss?
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (8 by maintainers)
Top GitHub Comments
@BDisp Neat 🙂. Thanks! Going to update my crutchy half-baked db picker 😃
@BDisp I see. Sorry for bothering with newbie questions. It looks like this now. Big thanks!