本文整理汇总了Golang中github.com/rthornton128/goncurses.Window.ScrollOk方法的典型用法代码示例。如果您正苦于以下问题:Golang Window.ScrollOk方法的具体用法?Golang Window.ScrollOk怎么用?Golang Window.ScrollOk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/rthornton128/goncurses.Window
的用法示例。
在下文中一共展示了Window.ScrollOk方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: createMainWindows
//creates the three Main big windows that make up the GUI
func createMainWindows(stdscr *gc.Window) (*gc.Window, *gc.Window, *gc.Window, *gc.Window, *gc.Window) {
rows, cols := stdscr.MaxYX()
height, width := rows, int(float64(cols)*.2)
var contactsWin, messageWinBorder, inputBorderWin, inputWin *gc.Window
var err error
contactsWin, err = gc.NewWindow(height, width, 0, 0)
if err != nil {
log.Fatal("Failed to create Contact Window:", err)
}
err = contactsWin.Border('|', '|', '-', '-', '+', '+', '+', '+')
if err != nil {
log.Fatal("Failed to create Border of Contact Window:", err)
}
// messageWinBorder is just the border. msgWin is the actual input window
// doing this simplifies handling text a fair amount.
// also the derived function never errors. Which seems dangerous
begin_x := width + 1
height = int(float64(rows) * .8)
width = int(float64(cols) * .8)
messageWinBorder, err = gc.NewWindow(height, width, 0, begin_x)
if err != nil {
log.Fatal("Failed to create Message Border Window:", err)
}
err = messageWinBorder.Border('|', '|', '-', '-', '+', '+', '+', '+')
if err != nil {
log.Fatal("Failed to create Border of Message Window:", err)
}
msgWin, err := gc.NewWindow((height - 2), (width - 2), 1, (begin_x + 1))
if err != nil {
log.Fatal("Failed to create the message Window:", err)
}
begin_y := int(float64(rows)*.8) + 1
height = int(float64(rows) * .2)
inputBorderWin, err = gc.NewWindow(height, width, begin_y, begin_x)
if err != nil {
log.Fatal("Failed to create InputBorder Window:", err)
}
err = inputBorderWin.Border('|', '|', '-', '-', '+', '+', '+', '+')
if err != nil {
log.Fatal("Failed to create Border of the InputBorder Window:", err)
}
// inputBorderWin is just the border. InputWin is the actual input window
// doing this simplifies handling text a fair amount.
// also the derived function never errors. Which seems dangerous
inputWin, err = gc.NewWindow((height - 2), (width - 2), (begin_y + 1), (begin_x + 1))
if err != nil {
log.Fatal("Failed to create the inputWin Window:", err)
}
inputWin.ScrollOk(true)
inputWin.Keypad(true)
msgWin.ScrollOk(true)
return contactsWin, messageWinBorder, msgWin, inputBorderWin, inputWin
}