| 1 | // mauview - A Go TUI library based on tcell. |
| 2 | // Copyright © 2019 Tulir Asokan |
| 3 | // |
| 4 | // This Source Code Form is subject to the terms of the Mozilla Public |
| 5 | // License, v. 2.0. If a copy of the MPL was not distributed with this |
| 6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 7 | |
| 8 | package mauview |
| 9 | |
| 10 | type genericChild struct { |
| 11 | screen *ProxyScreen |
| 12 | target Component |
| 13 | } |
| 14 | |
| 15 | func (child genericChild) Focus() { |
| 16 | focusable, ok := child.target.(Focusable) |
| 17 | if ok { |
| 18 | focusable.Focus() |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | func (child genericChild) Blur() { |
| 23 | focusable, ok := child.target.(Focusable) |
| 24 | if ok { |
| 25 | focusable.Blur() |
| 26 | } |
| 27 | } |