当前位置: 首页>>代码示例>>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;未经允许,请勿转载。