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

Single window #2349

Closed
mnemode2 opened this issue Feb 14, 2019 · 5 comments
Closed

Single window #2349

mnemode2 opened this issue Feb 14, 2019 · 5 comments

Comments

@mnemode2
Copy link

I want to use imgui for my simple windows application, I want one window with several controls (bottons, etc)
Is this possible to create such window with imgui?
I don't want one big window with imgui subwindows but one imgui window with controls

NOT like this:
image

I want to build desktop app

@ocornut
Copy link
Owner

ocornut commented Feb 14, 2019

Just create an OS window that doesn't have OS decorations, then create an imgui window that fills the OS window using SetNextWindowPos(ImVec2(0,0)); SetNextWindowSize(io.DisplaySize);`

@ocornut ocornut closed this as completed Feb 14, 2019
@mnemode2
Copy link
Author

" OS window that doesn't have OS decorations"
How can I do that on Windows?
via CreateWindow?

@ocornut
Copy link
Owner

ocornut commented Feb 14, 2019

That's not a question related to Dear ImGui. Look up for WS_POPUP WS_EX_TOOLWINDOW flag in Win32 api.

@mehditlili
Copy link

Just to precise, SetNextWindowPos(ImVec2(0,0)); SetNextWindowSize(io.DisplaySize); as the name hints should be called before creating the window. On Linux at least, I get an Imgui window without an X button unlike the example above. So keeping the window decorator of my OS is preferred (Using Compiz)

@ocornut
Copy link
Owner

ocornut commented Mar 13, 2023

Amending this old thread

You should not do:

SetNextWindowPos(ImVec2(0,0)); 
SetNextWindowSize(io.DisplaySize); 

But:

ImGuiViewport* viewport = ImGui::GetMainViewport():
SetNextWindowPos(viewport->Pos); 
SetNextWindowSize(viewport->Size); 

To ignore main menu bar.

Which you can also change:

ImGuiViewport* viewport = ImGui::GetMainViewport():
SetNextWindowPos(viewport->WorkPos); 
SetNextWindowSize(viewport->WorkSize); 

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

3 participants