atomize-element-interface #2

Merged
sashakoshka merged 20 commits from atomize-element-interface into main 2023-01-16 10:24:23 -07:00
2 changed files with 73 additions and 122 deletions
Showing only changes of commit 8cfb8eeaef - Show all commits

View File

@ -15,10 +15,6 @@ type ParentHooks struct {
// event. // event.
MinimumSizeChange func (width, height int) MinimumSizeChange func (width, height int)
// SelectabilityChange is called when the chid element becomes
// selectable or non-selectable.
SelectabilityChange func (selectable bool)
// SelectionRequest is called when the child element element wants // SelectionRequest is called when the child element element wants
// itself to be selected. If the parent element chooses to grant the // itself to be selected. If the parent element chooses to grant the
// request, it must send the child element a selection event and return // request, it must send the child element a selection event and return
@ -50,14 +46,6 @@ func (hooks ParentHooks) RunSelectionRequest () (granted bool) {
return return
} }
// RunSelectabilityChange runs the SelectionRequest hook if it is not nil. If it
// is nil, it does nothing.
func (hooks ParentHooks) RunSelectabilityChange (selectable bool) {
if hooks.SelectabilityChange != nil {
hooks.SelectabilityChange(selectable)
}
}
// Element represents a basic on-screen object. // Element represents a basic on-screen object.
type Element interface { type Element interface {
// Element must implement the Canvas interface. Elements should start // Element must implement the Canvas interface. Elements should start