1 Star 0 Fork 1

pispanda / walk

forked from arao / walk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
walk.go 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
Alexander Neumann 提交于 2017-02-27 17:21 . Button: Add Image property
// Copyright 2011 The Walk Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build windows
package walk
import (
"errors"
)
var (
ErrInvalidType = errors.New("invalid type")
)
func LogErrors() bool {
return logErrors
}
func SetLogErrors(v bool) {
logErrors = v
}
func PanicOnError() bool {
return panicOnError
}
func SetPanicOnError(v bool) {
panicOnError = v
}
func TranslationFunc() TranslationFunction {
return translation
}
func SetTranslationFunc(f TranslationFunction) {
translation = f
}
type TranslationFunction func(source string, context ...string) string
var translation TranslationFunction
func tr(source string, context ...string) string {
if translation == nil {
return source
}
return translation(source, context...)
}
type Disposable interface {
Dispose()
}
type Disposables struct {
items []Disposable
done bool
}
func (d *Disposables) Add(item Disposable) {
d.items = append(d.items, item)
}
func (d *Disposables) Spare() {
d.done = true
}
func (d *Disposables) Treat() {
if d.done {
return
}
for _, item := range d.items {
item.Dispose()
}
d.done = true
}
Go
1
https://gitee.com/pispanda/walk.git
git@gitee.com:pispanda/walk.git
pispanda
walk
walk
a5fea13dfac9

搜索帮助