ui/cocoa/window.m

Sat, 29 Mar 2014 12:15:39 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 29 Mar 2014 12:15:39 +0100
changeset 12
fe94e0fb9ef3
parent 10
6f263196f916
child 14
e2fd132ab781
permissions
-rw-r--r--

added some text functions

7
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 /*
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 *
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 * Copyright 2012 Olaf Wintermann. All rights reserved.
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 *
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 *
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 *
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 *
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 */
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 #include <stdio.h>
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31 #import "window.h"
10
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
32 #import "menu.h"
7
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33 #import "toolbar.h"
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34 #import "container.h"
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35 #import "../../ucx/mempool.h"
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36 #import "../common/context.h"
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38 static int window_default_width = 600;
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39 static int window_default_height = 500;
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
40
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
41 @implementation UiCocoaWindow
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
42
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
43 - (UiObject*) object {
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
44 return uiobj;
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
45 }
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
47 - (void) setObject:(UiObject*)obj {
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48 uiobj = obj;
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49 }
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50
10
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
51 - (void) setMenuItems:(UcxList*)menuItems {
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
52 UcxAllocator *allocator = uiobj->ctx->mempool->allocator;
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
53 menus = ucx_map_new_a(allocator, 8);
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
54 items = ucx_map_new_a(allocator, 64);
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
55
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
56 UCX_FOREACH(elm, menuItems) {
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
57 UiStateItem *item = elm->data;
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
58 NSMenu *menu = [item->item menu];
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
59
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
60 // create UiMenuItem which represents an NSMenuItem for a Window
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
61 UiMenuItem *windowItem = ucx_mempool_malloc(uiobj->ctx->mempool, sizeof(UiMenuItem));
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
62 windowItem->item = item->item;
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
63 windowItem->state = 0;
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
64 if(item->var) {
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
65 // bind value
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
66 UiVar *var = uic_connect_var(uiobj->ctx, item->var, UI_VAR_INTEGER);
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
67 if(var) {
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
68 UiInteger *value = var->value;
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
69 value->obj = windowItem;
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
70 value->get = ui_menuitem_get;
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
71 value->set = ui_menuitem_set;
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
72 value = 0;
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
73 } else {
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
74 // TODO: error
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
75 }
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
76 }
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
77
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
78 // add item
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
79 UcxList *itemList = ucx_map_get(menus, ucx_key(&menu, sizeof(void*)));
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
80 itemList = ucx_list_append_a(allocator, itemList, windowItem);
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
81 ucx_map_put(menus, ucx_key(&menu, sizeof(void*)), itemList);
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
82
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
83 ucx_map_put(items, ucx_key(&windowItem->item, sizeof(void*)), windowItem);
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
84 }
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
85 }
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
86
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
87 - (UiMenuItem*) getMenuItem:(NSMenuItem*)item {
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
88 return ucx_map_get(items, ucx_key(&item, sizeof(void*)));
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
89 }
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
90
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
91 - (void) updateMenu:(NSMenu*)menu {
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
92 UcxList *itemList = ucx_map_get(menus, ucx_key(&menu, sizeof(void*)));
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
93 UCX_FOREACH(elm, itemList) {
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
94 UiMenuItem *item = elm->data;
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
95
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
96 [item->item setState: item->state];
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
97 }
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
98 }
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
99
7
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
100 @end
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
101
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
102
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
103 /* ------------------------------ public API ------------------------------ */
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
104
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
105 UiObject* ui_window(char *title, void *window_data) {
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
106 UcxMempool *mp = ucx_mempool_new(256);
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
107 UiObject *obj = ucx_mempool_calloc(mp, 1, sizeof(UiObject));
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
108 obj->ctx = uic_context(obj, mp);
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
109
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
110 // create native window
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
111 NSRect frame = NSMakeRect(
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
112 300,
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
113 200,
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
114 window_default_width,
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
115 window_default_height);
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
116
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
117 UiCocoaWindow *window = [[UiCocoaWindow alloc] initWithContentRect:frame
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
118 styleMask:NSTitledWindowMask | NSResizableWindowMask |
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
119 NSClosableWindowMask | NSMiniaturizableWindowMask
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
120 backing:NSBackingStoreBuffered
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
121 defer:false];
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
122
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
123 [window setObject: obj];
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
124 NSString *titleStr = [[NSString alloc] initWithUTF8String:title];
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
125 [window setTitle:titleStr];
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
126
10
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
127 UiMenuDelegate *menuDelegate = ui_menu_delegate();
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
128 [window setMenuItems: [menuDelegate items]];
6f263196f916 added Cocoa implementation for menu check items (with bugs)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
129
7
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
130 NSToolbar *toolbar = ui_create_toolbar();
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
131 [window setToolbar: toolbar];
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
132
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
133 obj->widget = (NSView*)window;
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
134 obj->window = window_data;
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
135 obj->document = NULL;
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
136 obj->container = ui_window_container(obj, window);
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
137
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
138
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
139 return obj;
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
140 }

mercurial