Skip to content

When adding more than one Window + TextView together with a MenuBar, the displayed text changes to the text of the first added Window #3545

@luizfernandonb

Description

@luizfernandonb

Describe the bug
When more than one Window is added together with a TextView and a MenuBar is also added, when hovering the mouse over the console the text displayed is that of the first Window added
I don't know if I explained it correctly, sorry

To Reproduce
The code below shows the bug:

using Terminal.Gui;

Application.Init();

var menuBar = new MenuBar
{
    Menus =
    [
        new()
        {
            Title = "Foo",
            Children =
            [
                new()
                {
                    Title = "Bar",
                },
            ]
        },
    ],
};

foreach (var arg in new[] { "1", "2" })
{
    var win = new Window()
    {
        Title = arg,
    };

    var editor = new TextView()
    {
        Width = Dim.Fill(),
        Height = Dim.Fill(),
        Text = arg
    };

    win.Add(editor);

    Application.Top.Add(win);
}

Application.Top.Add(menuBar);
Application.Run();
Application.Shutdown();

Expected behavior
The same thing is expected to happen when the MenuBar is not added (Just comment on Application.Top.Add(menuBar)), the text displayed is that of the last Window added and when hovering the mouse over it, the text remains the same

Screenshots
When starting the program:
image

After hovering the mouse over the console:
image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions