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 |