func ancestor(w Widget) Form { if w == nil { return nil } hWndRoot := win.GetAncestor(w.Handle(), win.GA_ROOT) rw, _ := windowFromHandle(hWndRoot).(Form) return rw }
func (wb *WindowBase) writePath(buf *bytes.Buffer) { hWndParent := win.GetAncestor(wb.hWnd, win.GA_PARENT) if pwi := windowFromHandle(hWndParent); pwi != nil { if sv, ok := pwi.(*ScrollView); ok { pwi = sv.Parent() } pwi.AsWindowBase().writePath(buf) buf.WriteByte('/') } buf.WriteString(wb.name) }