mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
app,internal/debug: define GIODEBUG env var
This commit defines an environment-variable-based debug mechanism allowing users to toggle various debug features of their applications at runtime. The only currently supported features are debug logging in the text stack and suppressing the usage message that would otherwise be printed if you supplied a malformed GIODEBUG value. The syntax is a comma-delimited list of features right now. To see the usage, set the variable to the empty string (or any other unsupported value): $ GIODEBUG="" go run . To suppress the usage message, use GIODEBUG=silent. This may be helpful for scripts trying to activate debug features and inspect their output across versions of Gio with different debug options available. Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
"gioui.org/f32"
|
||||
"gioui.org/font/gofont"
|
||||
"gioui.org/gpu"
|
||||
"gioui.org/internal/debug"
|
||||
"gioui.org/internal/ops"
|
||||
"gioui.org/io/event"
|
||||
"gioui.org/io/key"
|
||||
@@ -136,6 +137,7 @@ type queue struct {
|
||||
// Calling NewWindow more than once is not supported on
|
||||
// iOS, Android, WebAssembly.
|
||||
func NewWindow(options ...Option) *Window {
|
||||
debug.Parse()
|
||||
// Measure decoration height.
|
||||
deco := new(widget.Decorations)
|
||||
theme := material.NewTheme(gofont.Regular())
|
||||
|
||||
Reference in New Issue
Block a user