mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-10 19:03:30 +00:00
Multiple windows with the same name. #4366
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#4366
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version: 1.83
Branch: docking
**My Issue/Question:**How can I have multiple windows (initialized with
::Begin) with the same name?I'm trying to have multiple windows for my game engine called "Project Hierarchy" and "Map Hierarchy", which works fine... until I have two instances of a window like "Map Hierarchy" open, in which case they will have duplicated instances on one window instead of separate windows.
Screenshot

ui.cpp
ui.hpp
app.cpp
If you do use this code, just call the Render function of win_mapHierarchy, I did remove a lot of code from this uploaded code to simplify it and still have it usable, but yeah, if you make two instances of
WindowMapHierarchy win_mapHierarchy{};in the app implementation file, and call both of the Render functions one after another, all the elements get combined into one, any solution for this?See
Demo>Examples>Manipulating window titlesAnd see FAQ entries:
"How can I have multiple widgets with the same label?"https://github.com/ocornut/imgui/blob/master/docs/FAQ.md#q-how-can-i-have-multiple-widgets-with-the-same-label
Same answer applies.
Using
Begin()with the same identifier allows appending to a same window from a different location.