diff --git a/examples/widgets/widgets.go b/examples/widgets/widgets.go index 2b187e93..37b9bd46 100644 --- a/examples/widgets/widgets.go +++ b/examples/widgets/widgets.go @@ -6,6 +6,7 @@ import ( "image/color" "time" + "github.com/AllenDang/giu" g "github.com/AllenDang/giu" ) @@ -179,11 +180,13 @@ func loop() { g.TreeNode("TreeNode with event handler").Layout( g.Selectable("Selectable 1").OnClick(func() { fmt.Println(1) }), g.Selectable("Selectable 2").OnClick(func() { fmt.Println(2) }), - ).Event(func() { - if g.IsItemClicked(g.MouseButtonLeft) { - fmt.Println("Clicked") - } - }), + ).EventHandler(giu.Event().OnClick(giu.MouseButtonLeft, func() { + fmt.Println("Clicked") + }).OnDClick(giu.MouseButtonLeft, func() { + fmt.Println("Double-Clicked") + }).OnClick(giu.MouseButtonRight, func() { + fmt.Println("Right-Clicked") + })), ), g.TabItem("TreeTable").Layout( g.TreeTable().