ui/cocoa/toolkit.m

changeset 31
34df61c6ec3c
parent 29
c96169444d88
child 48
0b8ac9d6d473
equal deleted inserted replaced
30:34513f76d5a8 31:34df61c6ec3c
200 200
201 - (BOOL)handleEvent:(id)sender { 201 - (BOOL)handleEvent:(id)sender {
202 NSWindow *activeWindow = [NSApp keyWindow]; 202 NSWindow *activeWindow = [NSApp keyWindow];
203 203
204 UiEvent event; 204 UiEvent event;
205 event.eventdata = NULL;
205 if([activeWindow class] == [UiCocoaWindow class]) { 206 if([activeWindow class] == [UiCocoaWindow class]) {
206 event.obj = [(UiCocoaWindow*)activeWindow object]; 207 event.obj = [(UiCocoaWindow*)activeWindow object];
207 event.window = event.obj->window; 208 event.window = event.obj->window;
208 event.document = event.obj->document; 209 event.document = event.obj->document;
209 event.intval = value; 210 event.intval = value;
220 NSMenuItem *item = (NSMenuItem*)sender; 221 NSMenuItem *item = (NSMenuItem*)sender;
221 int state = [item state] ? NSOffState : NSOnState; 222 int state = [item state] ? NSOffState : NSOnState;
222 223
223 UiEvent event; 224 UiEvent event;
224 event.intval = state; 225 event.intval = state;
226 event.eventdata = NULL;
225 if([activeWindow class] == [UiCocoaWindow class]) { 227 if([activeWindow class] == [UiCocoaWindow class]) {
226 event.obj = [(UiCocoaWindow*)activeWindow object]; 228 event.obj = [(UiCocoaWindow*)activeWindow object];
227 event.window = event.obj->window; 229 event.window = event.obj->window;
228 event.document = event.obj->document; 230 event.document = event.obj->document;
229 // update state in window data 231 // update state in window data

mercurial