gio UI. 如何使窗口全屏显示

huangapple go评论126阅读模式
英文:

gio UI. how to make fullscreen

问题

我想使用Gio UI框架创建一个全屏窗口。但是应用程序始终处于窗口模式。

根据我的理解,这段代码应该实现全屏应用程序。

func main() {
	go func() {
		w := app.NewWindow(app.Title("fullscr"),
			app.Fullscreen.Option(),
			app.Decorated(false),
		)

		if err := draw(w); err != nil {
			log.Fatal(err)
		}
	}()
	app.Main()
}
英文:

I want to make a full screen window using the Gio UI framework.
But the application is in windowed mode all the time.

As I understood it, this code was supposed to result in a full screen application.

func main() {
	go func() {
		w := app.NewWindow(app.Title("fullscr"),
			app.Fullscreen.Option(),
			app.Decorated(false),
		)

		if err := draw(w); err != nil {
			log.Fatal(err)
		}
	}()
	app.Main()
}

答案1

得分: 1

感谢@kostix和他的评论,我找到了一个解决方案。我将w.Option(app.Fullscreen.Option())放在draw函数中。

英文:

Thanks to @kostix and his comment, I found a solution. I placed w.Option(app.Fullscreen.Option()) in draw function

huangapple
  • 本文由 发表于 2023年6月23日 23:16:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/76541439.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定