mirror of https://github.com/anoshenko/rui.git
Update customView.go
This commit is contained in:
parent
7214eda01d
commit
73b0ee0c5c
|
|
@ -246,13 +246,33 @@ func (customView *CustomViewData) isNoResizeEvent() bool {
|
||||||
// Views return a list of child views
|
// Views return a list of child views
|
||||||
func (customView *CustomViewData) Views() []View {
|
func (customView *CustomViewData) Views() []View {
|
||||||
if customView.superView != nil {
|
if customView.superView != nil {
|
||||||
if container, ok := customView.superView.(ViewsContainer); ok {
|
if container, ok := customView.superView.(ParentView); ok {
|
||||||
return container.Views()
|
return container.Views()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return []View{}
|
return []View{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (customView *CustomViewData) ViewSeq() iter.Seq[View] {
|
||||||
|
if customView.superView != nil {
|
||||||
|
if container, ok := customView.superView.(ParentView); ok {
|
||||||
|
return container.ViewSeq()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return func(yield func(View) bool) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (customView *CustomViewData) ViewCount() int {
|
||||||
|
if customView.superView != nil {
|
||||||
|
if container, ok := customView.superView.(ParentView); ok {
|
||||||
|
return container.ViewCount()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
// Append appends a view to the end of the list of a view children
|
// Append appends a view to the end of the list of a view children
|
||||||
func (customView *CustomViewData) Append(view View) {
|
func (customView *CustomViewData) Append(view View) {
|
||||||
if customView.superView != nil {
|
if customView.superView != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue