本文整理匯總了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
}
示例2: delView
func delView(g *gocui.Gui, s string) error {
if err := g.DeleteView(s); err != nil {
return err
}
return nil
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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)
}
示例8: delMsg
func delMsg(g *gocui.Gui, v *gocui.View) error {
if err := g.DeleteView("msg"); err != nil {
return err
}
return nil
}
示例9: DeleteCommentView
func (c *commentView) DeleteCommentView(g *gocui.Gui) error {
return g.DeleteView(fmt.Sprintf("comment-%d", *c.ic.issue.Number))
}
示例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
}