giu icon indicating copy to clipboard operation
giu copied to clipboard

widgets/popupmodal: creating popup with the same id two times causes connecting its layouts

Open gucio321 opened this issue 4 years ago • 4 comments

related with #288

when creating two popups with the same id, they layouts are joined and rendered together. see demo code:

package main

import "github.com/AllenDang/giu"

func loop() {
        const id = "popupid"
        giu.SingleWindow().Layout(
                giu.Button("Open").OnClick(func() { giu.OpenPopup(id) }),
                giu.PopupModal(id).Layout(giu.Label("label 1")),
                giu.PopupModal(id).Layout(giu.Label("label 2")),
        )
}

func main() {
        wnd := giu.NewMasterWindow("msgbox-demo", 640, 480, 0)
        wnd.Run(loop)
}

image

is it a bug or thats just a feature? :grinning:

gucio321 avatar Aug 21 '21 17:08 gucio321

It is the design of imgui.

AllenDang avatar Aug 22 '21 03:08 AllenDang

@AllenDang so it isn't a bug?

gucio321 avatar Aug 22 '21 18:08 gucio321

@gucio321 It is a bug for upstream.

AllenDang avatar Aug 23 '21 05:08 AllenDang

Sr forgot about this issue 😊. Will try to reproduce in plain c++ version and report

gucio321 avatar Jul 22 '22 06:07 gucio321