示例#1
0
文件: window.go 项目: kumakichi/walk
// SetEnabled sets if the *WindowBase is enabled for user interaction.
func (wb *WindowBase) SetEnabled(value bool) {
	wb.enabled = value

	win.EnableWindow(wb.hWnd, wb.window.Enabled())

	wb.enabledChangedPublisher.Publish()
}
示例#2
0
文件: util.go 项目: kumakichi/walk
func setDescendantsEnabled(window Window, enabled bool) {
	wb := window.AsWindowBase()
	wb.SetEnabled(enabled)

	walkDescendants(window, func(w Window) bool {
		if w.Handle() == wb.hWnd {
			return true
		}

		win.EnableWindow(w.Handle(), enabled && w.AsWindowBase().enabled)

		return true
	})
}