question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected difference between ListView and FrameView

See original GitHub issue
open 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, HashSet1 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?

@tig @BDisp

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
En3Thocommented, Sep 25, 2021

@BDisp Neat 🙂. Thanks! Going to update my crutchy half-baked db picker 😃

1reaction
En3Thocommented, Sep 24, 2021

@BDisp I see. Sorry for bothering with newbie questions. It looks like this now. Big thanks! image

Read more comments on GitHub >

github_iconTop Results From Across the Web

EASY FIX: Runescape incompatible with GeForce ...
The good news is this is an easy fix! Open the Run Prompt with Windows Key + R. type "services.msc". Locate "NVIDIA FrameView...
Read more >
FrameView 1.2 | User Guide
FrameView is a software tool designed to capture and measure performance and power utilization of PC-based graphics and CPU hardware.
Read more >
unexpected touch changes the child fragment while using ...
It seems it's a problem inside the ObservableListView. To intercept touch events, ObservableListView is designed to call its parent's ...
Read more >
Understanding how and when SwiftUI decides to redraw ...
It appears that SwiftUI determines whether a struct is a plain data type, or a more complex one by running the built-in _isPOD...
Read more >
FrameLayout | Android Developers
FrameLayout is designed to block out an area on the screen to display a single item. Generally, FrameLayout should be used to hold...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found