亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用 GXUI 在 Go 中滾動窗口

使用 GXUI 在 Go 中滾動窗口

Go
Qyouu 2021-10-18 17:11:20
我正在嘗試使用 GXUI 在 Go 中向我的應用程序窗口添加滾動條。說我有這個代碼:package mainimport (    "fmt"    "github.com/google/gxui"    "github.com/google/gxui/drivers/gl"    "github.com/google/gxui/samples/flags"    "github.com/google/gxui/themes/dark")func appMain(driver gxui.Driver) {    theme := dark.CreateTheme(driver)    window := theme.CreateWindow(800, 600, "Grid")    window.SetScale(flags.DefaultScaleFactor)    window.OnClose(driver.Terminate)    row := theme.CreateLinearLayout()    row.SetDirection(gxui.LeftToRight)    for c := 0; c < 4; c++ {        col := theme.CreateLinearLayout()        col.SetDirection(gxui.TopToBottom)        for r := 0; r < 100; r++ {            cell := theme.CreateLabel()            cell.SetText(fmt.Sprintf("%d", r*4+c))            col.AddChild(cell)        }        row.AddChild(col)    }    window.AddChild(row)}func main() {    gl.StartDriver(appMain)}當我運行它時,我得到這個窗口:如何讓窗口具有滾動條以便我可以查看所有行?
查看完整描述

2 回答

  • 2 回答
  • 0 關注
  • 223 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號