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

Method confirmDialog

core/funcbutton.go:315–325  ·  view source on GitHub ↗

confirmDialog runs the confirm dialog.

()

Source from the content-addressed store, hash-verified

313
314// confirmDialog runs the confirm dialog.
315func (fb *FuncButton) confirmDialog() {
316 ctx := fb.goodContext()
317 d := NewBody().AddTitle(fb.Text + "?").AddText("Are you sure you want to run " + fb.Text + "? " + fb.Tooltip)
318 d.AddBottomBar(func(parent Widget) {
319 d.AddCancel(parent)
320 d.AddOK(parent).SetText(fb.Text).OnClick(func(e events.Event) {
321 fb.callFuncShowReturns()
322 })
323 })
324 d.RunDialog(ctx)
325}
326
327// CallFunc calls the function associated with this button,
328// prompting the user for any arguments.

Callers 1

CallFuncMethod · 0.95

Calls 11

goodContextMethod · 0.95
callFuncShowReturnsMethod · 0.95
NewBodyFunction · 0.85
AddTextMethod · 0.80
AddTitleMethod · 0.80
AddBottomBarMethod · 0.80
AddCancelMethod · 0.80
AddOKMethod · 0.80
RunDialogMethod · 0.80
OnClickMethod · 0.45
SetTextMethod · 0.45

Tested by

no test coverage detected