mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
ui/app: (macOS) use CFTypeRef for the view factory
The os and gl packages were separate in the past, which required uintptr for cross-package CFTypeRefs. That's no longer needed. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-2
@@ -25,8 +25,8 @@ type context struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
viewFactory = func() uintptr {
|
||||
return uintptr(C.gio_createGLView())
|
||||
viewFactory = func() C.CFTypeRef {
|
||||
return C.gio_createGLView()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -43,7 +43,7 @@ var singleWindow struct {
|
||||
opts *WindowOptions
|
||||
}
|
||||
|
||||
var viewFactory func() uintptr
|
||||
var viewFactory func() C.CFTypeRef
|
||||
|
||||
var views = make(map[C.CFTypeRef]*window)
|
||||
|
||||
@@ -200,7 +200,7 @@ func createWindow(opts *WindowOptions) error {
|
||||
}
|
||||
|
||||
func Main() {
|
||||
view := C.CFTypeRef(viewFactory())
|
||||
view := viewFactory()
|
||||
if view == 0 {
|
||||
// TODO: return this error from CreateWindow.
|
||||
panic(errors.New("CreateWindow: failed to create view"))
|
||||
|
||||
Reference in New Issue
Block a user