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

Menu appears in wrong place when opened in a subview #3968

Open
tznind opened this issue Mar 8, 2025 · 1 comment
Open

Menu appears in wrong place when opened in a subview #3968

tznind opened this issue Mar 8, 2025 · 1 comment
Labels
bug v2 For discussions, issues, etc... relavant for v2
Milestone

Comments

@tznind
Copy link
Collaborator

tznind commented Mar 8, 2025

Describe the bug
Opens in wrong place

To Reproduce

  1. Have a Toplevel
  2. Add a Window with some width/height sizing (like a Dialog has)
  3. Add a MenuBar
  4. Open Menu Bar

Here is some code to repro

        Application.Init ();

        var t = new Toplevel ();

        var w = new Window ();
        var menuBar = new Terminal.Gui.MenuBar ();
        w.Width = Dim.Percent (90);
        w.Height = Dim.Percent (80);
        w.X = Pos.Center ();
        w.Y = Pos.Center ();
        menuBar.Width = Dim.Fill (0);
        menuBar.Height = 1;
        menuBar.X = 0;
        menuBar.Y = 0;
        menuBar.Visible = true;
        menuBar.Arrangement = Terminal.Gui.ViewArrangement.Fixed;
        menuBar.CanFocus = false;
        menuBar.ShadowStyle = Terminal.Gui.ShadowStyle.None;
        menuBar.Data = "menuBar";
        menuBar.TextAlignment = Terminal.Gui.Alignment.Start;
        var fileF9Menu = new Terminal.Gui.MenuBarItem ();
        fileF9Menu.Title = "_File (F9)";
        var editMeMenuItem = new Terminal.Gui.MenuItem ();
        editMeMenuItem.Title = "Edit Me";
        editMeMenuItem.Data = "editMeMenuItem";
        fileF9Menu.Children = new Terminal.Gui.MenuItem [] {
        editMeMenuItem};
        menuBar.Menus = new Terminal.Gui.MenuBarItem [] {
        fileF9Menu};
        w.Add (menuBar);

        t.Add (w);
        Application.Run (t);
        Application.Shutdown ();

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
Image

@tznind tznind added bug v2 For discussions, issues, etc... relavant for v2 labels Mar 8, 2025
@tig
Copy link
Collaborator

tig commented Mar 8, 2025

I wouldn't waste any time on this.

This will be fixed, properly, in

Menu was never intended to be used like this.

@tig tig added this to the V2 Alpha milestone Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug v2 For discussions, issues, etc... relavant for v2
Projects
Status: No status
Development

No branches or pull requests

2 participants