atomize-element-interface #2
105
element.go
105
element.go
@ -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
|
||||||