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

Edit ImGui's Window Title to add a button #7518

Closed
luis605 opened this issue Apr 21, 2024 · 1 comment
Closed

Edit ImGui's Window Title to add a button #7518

luis605 opened this issue Apr 21, 2024 · 1 comment

Comments

@luis605
Copy link

luis605 commented Apr 21, 2024

Version/Branch of Dear ImGui:

1.90.5, Branch: docking

Back-ends:

rlImGui

Compiler, OS:

G++; Linux Mint

Full config/build information:

No response

Details:

My Issue/Question:

I'm trying to add a button next to the title of a Dear ImGui window, but I'm unable to achieve this directly using the provided functions.

Steps to Reproduce:

1. Attempt to add a button next to the title of a Dear ImGui window using the available functions.
2. Notice that the button appears below the title instead of next to it.

Expected Behavior:
I expect to be able to place a button directly adjacent to the title of a Dear ImGui window, similar to the functionality commonly seen in user interfaces.

Actual Behavior:
The button appears below the title of the window, rather than next to it.

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

// Here's some code anyone can copy and paste to reproduce your issue
ImGui::Begin("Example Bug");
    ImGui::SameLine(ImGui::GetWindowWidth() - ImGui::GetTextLineHeight());
    if (ImGui::Button("+"))
    {
        // Button action
    }

ImGui::End();
@ocornut
Copy link
Owner

ocornut commented Apr 22, 2024

This strategy anyhow won't work with docked windows.
Also see #5115 #5449 #3882 no need to open a duplicate issue.

I am planning to work on a way to do that easily with an API, before 1.91, but it might take a few months.

@ocornut ocornut closed this as completed Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants