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


Golang Screen.Render方法代碼示例

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


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

示例1: Render

//Render renders dry in the given screen
func Render(d *Dry, screen *ui.Screen, status *ui.StatusBar) {
	switch d.State.viewMode {
	case Main:
		{
			//after a refresh, sorting is needed
			d.dockerDaemon.Sort(d.State.SortMode)
			d.renderer.SortMode(d.State.SortMode)
			status.Render()
			screen.RenderLine(0, 0, `<right><white>`+time.Now().Format(`15:04:05`)+`</></right>`)
			screen.Render(1, d.renderer.Render())

			screen.RenderLineWithBackGround(0, screen.Height-1, keyMappings, ui.MenuBarBackgroundColor)
			d.State.changed = false
		}
	}

	screen.Flush()
}
開發者ID:hako,項目名稱:dry,代碼行數:19,代碼來源:render.go

示例2: Render

//Render renders dry in the given screen
func Render(d *Dry, screen *ui.Screen, status *ui.StatusBar) {
	switch d.state.viewMode {
	case Main:
		{
			//after a refresh, sorting is needed
			d.dockerDaemon.Sort(d.state.SortMode)
			d.renderer.SortMode(d.state.SortMode)
			status.Render()
			screen.RenderLine(0, 0, `<right><white>`+time.Now().Format(`15:04:05`)+`</></right>`)
			screen.Render(1, d.renderer.Render())
			screen.RenderLine(0, screenDescriptionIndex,
				fmt.Sprintf(
					"<b><blue>Containers: </><yellow>%d</></>", d.dockerDaemon.ContainersCount()))

			screen.RenderLineWithBackGround(0, screen.Height-1, keyMappings, ui.MenuBarBackgroundColor)
			d.state.changed = false
		}
	case Images:
		{
			status.Render()
			screen.RenderLine(0, 0, `<right><white>`+time.Now().Format(`15:04:05`)+`</></right>`)
			d.dockerDaemon.SortImages(d.state.SortImagesMode)

			screen.Render(1,
				appui.NewDockerImagesRenderer(d.dockerDaemon, screen.Height, screen.Cursor, d.state.SortImagesMode).Render())
			screen.RenderLine(0, screenDescriptionIndex,
				fmt.Sprintf(
					"<b><blue>Images: </><yellow>%d</></>", d.dockerDaemon.ImagesCount()))
			screen.RenderLineWithBackGround(0, screen.Height-1, imagesKeyMappings, ui.MenuBarBackgroundColor)
			d.state.changed = false
		}
	case Networks:
		{
			status.Render()
			screen.RenderLine(0, 0, `<right><white>`+time.Now().Format(`15:04:05`)+`</></right>`)

			screen.Render(1,
				appui.NewDockerNetworksRenderer(d.dockerDaemon, screen.Height, screen.Cursor, d.state.SortNetworksMode).Render())
			screen.RenderLine(0, screenDescriptionIndex,
				fmt.Sprintf(
					"<b><blue>Networks: </><yellow>%d</></>", d.dockerDaemon.NetworksCount()))
			screen.RenderLineWithBackGround(0, screen.Height-1, networkKeyMappings, ui.MenuBarBackgroundColor)
			d.state.changed = false
		}

	}

	screen.Flush()
}
開發者ID:ErezHorev,項目名稱:dry,代碼行數:50,代碼來源:render.go


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