本文整理匯總了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()
}
示例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()
}