Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested views throws TopologicalSort exception if they reference Pos/Dim to the root view. #2382

Closed
BDisp opened this issue Feb 26, 2023 · 1 comment
Labels

Comments

@BDisp
Copy link
Collaborator

BDisp commented Feb 26, 2023

Describe the bug
Referencing a root Pos/Dim from a recursive nested views will throws a TopologicalSort exception.

To Reproduce
Steps to reproduce the behavior:
Running this code will throw the error.

	Application.Init ();

	var top = Application.Top;
	var win = new Window ();
	var view1 = new View ("View1") {
		Id = "view1",
		X = Pos.Left (win) + 1,
		Y = Pos.Top (win) + 1,
		Width = Dim.Width (win) - 2,
		Height = Dim.Height (win) - 2
	};
	var view2 = new View ("View2") {
		Id = "view2",
		X = Pos.Left (win) + 2,
		Y = Pos.Top (win) + 2,
		Width = Dim.Width (win) - 4,
		Height = Dim.Height (win) - 4
	};
	view1.Add (view2);
	win.Add (view1);
	top.Add (win);

	Application.Run (top);
	Application.Shutdown ();

Expected behavior
Running without throw any exception when the root in the tree isn't null from the nested view.

BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Feb 26, 2023
BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Feb 27, 2023
BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Feb 27, 2023
@tig tig added the bug label Feb 28, 2023
@BDisp
Copy link
Collaborator Author

BDisp commented Mar 16, 2023

Closing this because the fix was included in the v2 on PR #2385.

@BDisp BDisp closed this as completed Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants