summaryrefslogtreecommitdiff
path: root/prev/window_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2016-05-30 00:14:46 -0400
committerPietro Gagliardi <[email protected]>2016-05-30 00:14:46 -0400
commit52f7d276a6bb04b8827ac019ad1e135b43819cea (patch)
tree5f0ebbfdf5885ef832e77e243b5916e59f46ba18 /prev/window_darwin.go
parentc9b32c1333e4009b342eedc5f5b39127a724fb42 (diff)
Removed prev/.
Diffstat (limited to 'prev/window_darwin.go')
-rw-r--r--prev/window_darwin.go84
1 files changed, 0 insertions, 84 deletions
diff --git a/prev/window_darwin.go b/prev/window_darwin.go
deleted file mode 100644
index cffc2a0..0000000
--- a/prev/window_darwin.go
+++ /dev/null
@@ -1,84 +0,0 @@
-// 8 july 2014
-
-package ui
-
-import (
- "unsafe"
-)
-
-// #include "objc_darwin.h"
-import "C"
-
-type window struct {
- id C.id
-
- closing *event
-
- child Control
- container *container
-}
-
-func newWindow(title string, width int, height int, control Control) *window {
- id := C.newWindow(C.intptr_t(width), C.intptr_t(height))
- ctitle := C.CString(title)
- defer C.free(unsafe.Pointer(ctitle))
- C.windowSetTitle(id, ctitle)
- w := &window{
- id: id,
- closing: newEvent(),
- child: control,
- }
- C.windowSetDelegate(w.id, unsafe.Pointer(w))
- w.container = newContainer(w.child.resize)
- w.child.setParent(w.container.parent())
- C.windowSetContentView(w.id, w.container.id)
- // trigger an initial resize
- return w
-}
-
-func (w *window) Title() string {
- return C.GoString(C.windowTitle(w.id))
-}
-
-func (w *window) SetTitle(title string) {
- ctitle := C.CString(title)
- defer C.free(unsafe.Pointer(ctitle))
- C.windowSetTitle(w.id, ctitle)
-}
-
-func (w *window) Show() {
- C.windowShow(w.id)
- // TODO we need a dummy resize here because things might not be in the right place
-}
-
-func (w *window) Hide() {
- C.windowHide(w.id)
-}
-
-func (w *window) Close() {
- C.windowClose(w.id)
-}
-
-func (w *window) OnClosing(e func() bool) {
- w.closing.setbool(e)
-}
-
-func (w *window) Margined() bool {
- return w.container.margined
-}
-
-func (w *window) SetMargined(margined bool) {
- w.container.margined = margined
-}
-
-//export windowClosing
-func windowClosing(xw unsafe.Pointer) C.BOOL {
- w := (*window)(unsafe.Pointer(xw))
- close := w.closing.fire()
- if close {
- return C.YES
- }
- return C.NO
-}
-
-// no need for windowResized; the child container takes care of that