Files
AynaLivePlayer/gui/xfyne/window.go
Aynakeya 5cc5948a85 Merge 1.0.x branch (#8)
* rewrite

* update submodule

* make width height configurable

* update dependency

* update

* update file

* update dep

* fix basic config layout

* update plugin management

* more stuff

* add blacklist

* fix todo

* fix windows gethandle

* update windows update guide

* update windows build guide

* include go mod tidy in script

* update todo

* fix source session

* fix text output

* add plugin play duration control

* fix id diange not working

* update todo

* update version number
2024-04-22 21:21:02 -07:00

24 lines
582 B
Go

package xfyne
import (
"fyne.io/fyne/v2"
"github.com/go-gl/glfw/v3.3/glfw"
"reflect"
"unsafe"
)
// getGlfwWindow returns the glfw.Window pointer from a fyne.Window.
// very unsafe and ugly hacks. but it works.
func getGlfwWindow(window fyne.Window) *glfw.Window {
rv := reflect.ValueOf(window)
if rv.Type().String() != "*glfw.window" {
return nil
}
rv = rv.Elem()
var glfwWindowPtr uintptr = rv.FieldByName("viewport").Pointer()
for glfwWindowPtr == 0 {
glfwWindowPtr = rv.FieldByName("viewport").Pointer()
}
return (*glfw.Window)(unsafe.Pointer(glfwWindowPtr))
}