~strosel


#156 Unsupported syscall/js methods a month ago

Ticket created by ~strosel on ~eliasnaur/gio

When I was trying to compile my app to wasm I got the following error:

../../../go/pkg/mod/gioui.org@v0.0.0-20200813124137-6c30c6386ccf/gpu/gl/types_js.go:20:21: js.Value(p).IsUndefined undefined (type js.Value has no field or method IsUndefined)
../../../go/pkg/mod/gioui.org@v0.0.0-20200813124137-6c30c6386ccf/gpu/gl/types_js.go:20:51: js.Value(p).IsNull undefined (type js.Value has no field or method IsNull)
../../../go/pkg/mod/gioui.org@v0.0.0-20200813124137-6c30c6386ccf/gpu/gl/types_js.go:24:21: js.Value(s).IsUndefined undefined (type js.Value has no field or method IsUndefined)
../../../go/pkg/mod/gioui.org@v0.0.0-20200813124137-6c30c6386ccf/gpu/gl/types_js.go:24:51: js.Value(s).IsNull undefined (type js.Value has no field or method IsNull)
../../../go/pkg/mod/gioui.org@v0.0.0-20200813124137-6c30c6386ccf/gpu/gl/types_js.go:28:21: js.Value(u).IsUndefined undefined (type js.Value has no field or method IsUndefined)
../../../go/pkg/mod/gioui.org@v0.0.0-20200813124137-6c30c6386ccf/gpu/gl/types_js.go:28:51: js.Value(u).IsNull undefined (type js.Value has no field or method IsNull)

and after some research it seems that IsUndefined and IsNull as well as other methods from syscall/js used in gio were not introduced until go1.14 leading to compilation errors when gio's go.mod specifies go1.13.

I would be happy to help in finding and replacing these methods in the source if upgrading to go1.14 isn't an option. However I suspect it might be easier with help and thought I should open an issue to let you know

#137 Requesting Permissions 3 months ago

Ticket created by ~strosel on ~eliasnaur/gio

In the docs for app/permission it says to use the Do method on the window to request so called "dangerous" permissions. In app/permission/storage storeage is described as such a "dangerous permission".

However as far as i can find nowhere in the docs or examples does it show gow to request a permission, someting I feel should be well documented if not even given it's own helper function.

If there allready is such documentation I would appreciate a comment on where to find it.

#90 special characters on android 6 months ago

Ticket created by ~strosel on ~eliasnaur/gio

Special characters such as åäö do not send events at all on android and as such cannot be inputed in editors.

It works on mac and i dont have oppertunity to test any other platforms.

#79 ImageOp not showing 8 months ago

Comment by ~strosel on ~eliasnaur/gio

ah, my mistake. Thanks a lot for the help!

REPORTED RESOLVED FIXED

#79 ImageOp not showing 8 months ago

Comment by ~strosel on ~eliasnaur/gio

My fix does not solve this issue. Here is a small example that gives an empty window

package main

import (
	"image"
	"image/png"
	"log"
	"os"

	"gioui.org/app"
	"gioui.org/io/system"
	"gioui.org/op"
	"gioui.org/op/paint"
	"golang.org/x/image/colornames"
)

var (
	sprite image.Image
	ops    *op.Ops
)

func loop(w *app.Window) error {
	for {
		e := <-w.Events()
		switch e := e.(type) {
		case system.DestroyEvent:
			return e.Err
		case system.FrameEvent:
			ops.Reset()
			paint.NewImageOp(image.NewUniform(colornames.Red)).Add(ops)
			paint.NewImageOp(sprite).Add(ops)
			e.Frame(ops)
		}
	}
}

func main() {
	f, err := os.Open("./sprites.png")
	if err != nil {
		log.Fatal(err)
	}
	defer f.Close()

	pic, err := png.Decode(f)
	if err != nil {
		log.Fatal(err)
	}
	sprite = pic
	ops = new(op.Ops)

	go func() {
		w := app.NewWindow()
		if err := loop(w); err != nil {
			log.Fatal(err)
		}
	}()

	app.Main()
}

#79 ImageOp not showing 8 months ago

Ticket created by ~strosel on ~eliasnaur/gio

I'm having issues with the painter.ImageOp op not drawing. I've tried both loading images from disk and using image.Uniform and yet nothing happens.

I tried looking at the source but it's a bit too advanced for me :/

grateful for answers and/or fixes