-
Notifications
You must be signed in to change notification settings - Fork 681
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
Scroll control doesn't work properly #2562
Comments
I couldn't reproduce this. I see you are using the scroll inside a frame. On what |
Or if you are using the Nuget package? If so what version? Are you able to provide a link to your source code or give any more details. For example where do you launch the View, do you call Application.Init etc. |
I ha have 1.72 version with win 11, I have added scroll inside window |
When I run my app on win 11, controls are mixed then I fix it by expanding the window with the mouse. |
I recommend you to download the current v1 from the repo, which is the |
I work with frame in scrollView, I fill it dinamic also I can't delete frame, I tryed FrameView.SubViews[0].Subviews.Clear(); but it throws error FrameView FrameControl = new FrameView() |
When scroll controls become mixed then throw this error |
You can't remove the |
This scenario https://github.com/gui-cs/Terminal.Gui/blob/develop/UICatalog/Scenarios/ASCIICustomButton.cs use a |
I don't think that's a great sample. It's quite convoluted.
|
Neither do I, btw labels not clickable anymore in the latest version, lot of bugs... |
Controls are mixed by default |
Very strange. Do you are using |
Yes it is windows console |
It seems that you are removing some views while |
Yes every one sec I have to use the same frameView with new data. The frameview contains some controls(labels and textfields). How can I do scroll and represent these dates in frameView? Can you write some lines with small example? The important thing is that frameView creates dinamically. My question is that how I can do scroll and fill data every sec in frameview? |
When updating Terminal.Gui from a Thread, the most important thing to do is to ensure any UI related code goes via |
@tznind thanks for clarifying. Application.MainLoop.Invoke () => {
scrollView.Remove(FrameControl);
FrameView FrameControl = new FrameView()
{
X = 0,
Y = 30
Width = 120,
Height = 0,
Border = new Border() { BorderStyle = BorderStyle.None, BorderThickness = new Thickness(1, 1, 1, 1) },
Visible = false,
Id = "Frame"
};
FrameControl .Add(new Label() { Y = brLines * 4, X = 12, Text = "1" });
FrameControl .Add(new Label() { Y = brLines * 4, X = 24, Text = "x", });
FrameControl .Add(new Label() { Y = brLines * 4, X = 36, Text = "2" });
scrollView.Add(FrameControl);
}; |
Thank you guys, it doesn't throws error but scroll does not work smoothly after some period |
I call it on this way Application.MainLoop.Invoke(async()=> { await RepresentData })}); RepresentData is a Task |
Because your are forcing it redrawing every one sec. Maybe you can increase that. Try this to enforce FrameControl disposing before recreating. scrollView.Remove(FrameControl);
FrameControl.Dispose();
FrameControl=null;
... |
That's ok, but you still must use inside the |
Doesn't seem like there's a bug here. Reopen if I'm wrong. |
C# code is below
var scrollView = new ScrollView();
scrollView.X = 0;
scrollView.Y = 0;
scrollView.Width = Dim.Fill();
scrollView.Height = Dim.Fill();
scrollView.ContentSize = new Size(Console.WindowWidth, Console.WindowHeight * 2);
When I scroll down, I got this error(below), I have win 11 ;(
A clear and concCollection was modified; enumeration operation may not execute.
at System.Collections.Generic.List
1.Enumerator.MoveNext() at Terminal.Gui.View.Redraw(Rect bounds) at Terminal.Gui.FrameView.Redraw(Rect bounds) at Terminal.Gui.View.Redraw(Rect bounds) at Terminal.Gui.ScrollView.Redraw(Rect region) at Terminal.Gui.View.Redraw(Rect bounds) at Terminal.Gui.Window.Redraw(Rect bounds) at Terminal.Gui.Application.RunMainLoopIteration(RunState& state, Boolean wait, Boolean& firstIteration) at Terminal.Gui.Application.RunLoop(RunState state, Boolean wait) at Terminal.Gui.Application.Run(Toplevel view, Func
2 errorHandler)at Terminal.Gui.MessageBox.QueryFull(Boolean useErrorColors, Int32 width, Int32 height, ustring title, ustring message, Int32
The text was updated successfully, but these errors were encountered: