本文整理汇总了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
}