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

Function CallFunc

core/funcbutton.go:26–28  ·  view source on GitHub ↗

CallFunc calls the given function in the context of the given widget, popping up a dialog to prompt for any arguments and show the return values of the function. It is a helper function that uses [NewSoloFuncButton] under the hood.

(ctx Widget, fun any)

Source from the content-addressed store, hash-verified

24// values of the function. It is a helper function that uses [NewSoloFuncButton]
25// under the hood.
26func CallFunc(ctx Widget, fun any) {
27 NewSoloFuncButton(ctx).SetFunc(fun).CallFunc()
28}
29
30// NewSoloFuncButton returns a standalone [FuncButton] with a fake parent
31// with the given context for popping up any dialogs.

Callers 7

InitMethod · 0.92
commitToVCSSelectedMethod · 0.92
makeColumnsMethod · 0.92
FileModCheckMethod · 0.92
SaveMethod · 0.92
TestCallFuncFunction · 0.85
TestCallFuncArgsFunction · 0.85

Calls 3

NewSoloFuncButtonFunction · 0.85
CallFuncMethod · 0.80
SetFuncMethod · 0.80

Tested by 2

TestCallFuncFunction · 0.68
TestCallFuncArgsFunction · 0.68