widgetNextFunc returns the next widget in the tree, including Parts, which are considered to come after children, continuing until the given function returns true. nil if no more.
(w Widget, fun func(w Widget) bool)
| 518 | // continuing until the given function returns true. |
| 519 | // nil if no more. |
| 520 | func widgetNextFunc(w Widget, fun func(w Widget) bool) Widget { |
| 521 | for { |
| 522 | nw := widgetNext(w) |
| 523 | if nw == nil { |
| 524 | return nil |
| 525 | } |
| 526 | if fun(nw) { |
| 527 | return nw |
| 528 | } |
| 529 | if nw == w { |
| 530 | slog.Error("WidgetNextFunc", "start", w, "nw == wi", nw) |
| 531 | return nil |
| 532 | } |
| 533 | w = nw |
| 534 | } |
| 535 | } |
| 536 | |
| 537 | // widgetPrevFunc returns the previous widget in the tree, |
| 538 | // including Parts, which are considered to come after children, |