Closed WinPooh32 closed 8 months ago
refer the ID policy defined in Imgui, quote from wiki:
Q: So how to set widget's ID manually?
A: Many widgets already implements (*XYZWidget).ID(string) method.
In many widgets its ID is equal to its label (e.g. for Buttons)
Q: But I want to have two buttons with the same label 😕 how to do this?
A: ID (label) consists of two parts - visible and invisible separated by double hash ("##"). For example, "Button##1", will be rendered as "Button". "##Button1" will be rendered as "".
What happend?
Set button's label as "label", but its "id", when ID("id") is called.
Code example
```golang package main import ( g "github.com/AllenDang/giu" ) func loop() { g.SingleWindow().Layout( g.Button("label").ID("id"), ) } func main() { wnd := g.NewMasterWindow("Huge list demo", 800, 600, 0) wnd.Run(loop) } ```main.go
To Reproduce
Version
(latest)
OS
Ubuntu 20.04.6