MCPcopy
hub / github.com/lxn/walk / WriteState

Method WriteState

window.go:2106–2121  ·  view source on GitHub ↗
(state string)

Source from the content-addressed store, hash-verified

2104}
2105
2106func (wb *WindowBase) WriteState(state string) error {
2107 settings := App().Settings()
2108 if settings == nil {
2109 return newError("App().Settings() must not be nil")
2110 }
2111
2112 p := wb.path()
2113 if strings.HasPrefix(p, "/") ||
2114 strings.HasSuffix(p, "/") ||
2115 strings.Contains(p, "//") {
2116
2117 return nil
2118 }
2119
2120 return settings.PutExpiring(p, state)
2121}
2122
2123func windowFromHandle(hwnd win.HWND) Window {
2124 if wb := hwnd2WindowBase[hwnd]; wb != nil {

Callers 8

SaveStateMethod · 0.80
SaveStateMethod · 0.80
SaveStateMethod · 0.80
SaveStateMethod · 0.80
SaveStateMethod · 0.80
SaveStateMethod · 0.80
SaveStateMethod · 0.80
SaveStateMethod · 0.80

Calls 6

pathMethod · 0.95
AppFunction · 0.85
newErrorFunction · 0.85
SettingsMethod · 0.80
PutExpiringMethod · 0.65
ContainsMethod · 0.45

Tested by

no test coverage detected