MCPcopy Create free account
hub / github.com/cogentcore/core / ExampleWidgetBase_AddCloseDialog

Function ExampleWidgetBase_AddCloseDialog

core/widgetevents_test.go:137–149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

135}
136
137func ExampleWidgetBase_AddCloseDialog() {
138 b := NewBody()
139 b.AddCloseDialog(func(d *Body) bool {
140 d.AddTitle("Are you sure?").AddText("Are you sure you want to close the Cogent Core Demo?")
141 d.AddBottomBar(func(parent Widget) {
142 d.AddOK(parent).SetText("Close").OnClick(func(e events.Event) {
143 b.Scene.Close()
144 })
145 })
146 return true
147 })
148 b.RunMainWindow()
149}

Callers

nothing calls this directly

Calls 10

RunMainWindowMethod · 0.95
NewBodyFunction · 0.85
AddCloseDialogMethod · 0.80
AddTextMethod · 0.80
AddTitleMethod · 0.80
AddBottomBarMethod · 0.80
AddOKMethod · 0.80
CloseMethod · 0.65
OnClickMethod · 0.45
SetTextMethod · 0.45

Tested by

no test coverage detected