當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Gui.DeleteView方法代碼示例

本文整理匯總了Golang中github.com/jroimartin/gocui.Gui.DeleteView方法的典型用法代碼示例。如果您正苦於以下問題:Golang Gui.DeleteView方法的具體用法?Golang Gui.DeleteView怎麽用?Golang Gui.DeleteView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/jroimartin/gocui.Gui的用法示例。


在下文中一共展示了Gui.DeleteView方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: changeHost

func changeHost(g *gocui.Gui, v *gocui.View) error {

	if err := g.DeleteView("summary"); err != nil {
		return err
	}
	if err := g.DeleteView("detail"); err != nil {
		return err
	}

	_, cy := v.Cursor()
	l, err := v.Line(cy)
	if err != nil {
		return err
	}
	serverName := strings.TrimSpace(l)

	for _, r := range scanHistory.ScanResults {
		if serverName == strings.TrimSpace(r.ServerInfoTui()) {
			currentScanResult = r
			break
		}
	}

	if err := setSummaryLayout(g); err != nil {
		return err
	}
	if err := setDetailLayout(g); err != nil {
		return err
	}
	return nil
}
開發者ID:Rompei,項目名稱:vuls,代碼行數:31,代碼來源:tui.go

示例2: delView

func delView(g *gocui.Gui, s string) error {
	if err := g.DeleteView(s); err != nil {
		return err
	}
	return nil

}
開發者ID:mkrapp,項目名稱:go-watch,代碼行數:7,代碼來源:go-watch.go

示例3: delMsg

func delMsg(g *gocui.Gui, v *gocui.View) error {
	if err := g.DeleteView("msg"); err != nil {
		return err
	}
	if _, err := g.SetCurrentView("side"); err != nil {
		return err
	}
	return nil
}
開發者ID:jroimartin,項目名稱:gocui,代碼行數:9,代碼來源:demo.go

示例4: hideMatched

func hideMatched(g *gocui.Gui, v *gocui.View) error {
	if err := g.DeleteView("matched"); err != nil {
		return err
	}
	if err := g.SetCurrentView("background"); err != nil {
		return err
	}
	return nil
}
開發者ID:social-bots,項目名稱:pyre,代碼行數:9,代碼來源:main.go

示例5: redrawDetail

func redrawDetail(g *gocui.Gui) error {
	if err := g.DeleteView("detail"); err != nil {
		return err
	}

	if err := setDetailLayout(g); err != nil {
		return err
	}
	return nil
}
開發者ID:Rompei,項目名稱:vuls,代碼行數:10,代碼來源:tui.go

示例6: delMsg

func delMsg(g *gocui.Gui, v *gocui.View) error {
	if err := g.DeleteView(vMessage); err != nil {
		return err
	}
	top(g, "Select target platform, source transcript and destination.")

	if err := g.SetCurrentView(vPlatforms); err != nil {
		return err
	}
	return nil
}
開發者ID:metalogic-software,項目名稱:go-examples,代碼行數:11,代碼來源:main.go

示例7: delView

func delView(g *gocui.Gui) error {
	if len(views) <= 1 {
		return nil
	}

	if err := g.DeleteView(views[curView]); err != nil {
		return err
	}
	views = append(views[:curView], views[curView+1:]...)

	return nextView(g, false)
}
開發者ID:repos-go,項目名稱:gocui,代碼行數:12,代碼來源:delete.go

示例8: delMsg

func delMsg(g *gocui.Gui, v *gocui.View) error {
	if err := g.DeleteView("msg"); err != nil {
		return err
	}
	return nil
}
開發者ID:jmptrader,項目名稱:gocui,代碼行數:6,代碼來源:mouse.go

示例9: DeleteCommentView

func (c *commentView) DeleteCommentView(g *gocui.Gui) error {
	return g.DeleteView(fmt.Sprintf("comment-%d", *c.ic.issue.Number))
}
開發者ID:pombredanne,項目名稱:stroop,代碼行數:3,代碼來源:comment_view.go

示例10: layout

func layout(g *gocui.Gui) error {
	maxX, maxY := g.Size()
	max := float32(maxX)
	playlistSize := max * 0.15
	trackSize := max * 0.60
	if v, err := g.SetView(VIEW_PLAYLISTS, -1, -1, int(playlistSize), maxY-2); err != nil {
		if err != gocui.ErrUnknownView {
			return err
		}
		gui.playlistsView = v
		gui.playlistsView.Highlight = true

		gui.updatePlaylistsView()

		if err := g.SetCurrentView(VIEW_PLAYLISTS); err != nil {
			return err
		}
	}
	if v, err := g.SetView(VIEW_TRACKS, int(playlistSize), -1, int(playlistSize+trackSize), maxY-2); err != nil {
		if err != gocui.ErrUnknownView {
			return err
		}
		gui.tracksView = v

		gui.updateTracksView()
	}
	if v, err := g.SetView(VIEW_QUEUE, int(playlistSize+trackSize), -1, maxX, maxY-2); err != nil {
		if err != gocui.ErrUnknownView {
			return err
		}
		gui.queueView = v
	}
	if v, err := g.SetView(VIEW_STATUS, -1, maxY-2, maxX, maxY); err != nil {
		if err != gocui.ErrUnknownView {
			return err
		}
		gui.statusView = v
	}
	if gui.showInfo {
		if subView, err := g.SetView(VIEW_ARTIST_INFO, 10, 1, 10+40, 1+2); err != nil {
			fmt.Fprintf(subView, "%v\n", gui.infoTrack.Artist.Name)
			gui.infoArtistView = subView
		}
		if subView, err := g.SetView(VIEW_TOP_TRACKS_INFO, 10, 1+2, 10+40, 1+2+12); err != nil {
			gui.infoTopTracksView = subView
		}
		if err := g.SetCurrentView(VIEW_TOP_TRACKS_INFO); err != nil {
			return err
		}

		gui.tracksView.Highlight = false
		gui.infoTopTracksView.Highlight = true
	} else if gui.infoArtistView != nil {
		g.DeleteView(VIEW_ARTIST_INFO)
		g.DeleteView(VIEW_TOP_TRACKS_INFO)
		gui.infoArtistView = nil
		gui.infoTopTracksView = nil
		if err := g.SetCurrentView(VIEW_TRACKS); err != nil {
			return err
		}
		gui.tracksView.Highlight = true
	}

	if !gui.initialised && loadStateWheInit {
		loadInitialState()
	}
	gui.initialised = true
	return nil
}
開發者ID:rdbrdd,項目名稱:sconsify,代碼行數:69,代碼來源:cui.go


注:本文中的github.com/jroimartin/gocui.Gui.DeleteView方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。