// New creates a new window.

New creates a new window.
// New creates a new window .
func New() (*Win, error) {
	fsysOnce.Do(mountAcme)
	if fsysErr != nil {
		return nil, fsysErr
	}
	fid, err := fsys.Open("new/ctl", plan9.ORDWR)
	if err != nil {
		return nil, err
	}
	buf := make([]byte, 100)
	n, err := fid.Read(buf)
	if err != nil {
		fid.Close()
		return nil, err
	}
	a := strings.Fields(string(buf[0:n]))
	if len(a) == 0 {
		fid.Close()
		return nil, errors.New("short read from acme/new/ctl")
	}
	id, err := strconv.Atoi(a[0])
	if err != nil {
		fid.Close()
		return nil, errors.New("invalid window id in acme/new/ctl: " + a[0])
	}
	return Open(id, fid)
}
func New ( ) ( * Win , error ) { fsysOnce . Do ( mountAcme ) if fsysErr != nil { return nil , fsysErr } fid , err := fsys . Open ( " " , plan9 . ORDWR ) if err != nil { return nil , err } buf := make ( [ ] byte , 100 ) n , err := fid . Read ( buf ) if err != nil { fid . Close ( ) return nil , err } a := strings . Fields ( string ( buf [ 0 : n ] ) ) if len ( a ) == 0 { fid . Close ( ) return nil , errors . New ( " " ) } id , err := strconv . Atoi ( a [ 0 ] ) if err != nil { fid . Close ( ) return nil , errors . New ( " " + a [ 0 ] ) } return Open ( id , fid ) }
New creates a new window.
New creates a new window .