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