188 obj->container = ui_window_container(obj, window); |
190 obj->container = ui_window_container(obj, window); |
189 |
191 |
190 |
192 |
191 return obj; |
193 return obj; |
192 } |
194 } |
|
195 |
|
196 char* ui_openfiledialog(UiObject *obj) { |
|
197 NSOpenPanel* op = [NSOpenPanel openPanel]; |
|
198 if ([op runModal] == NSOKButton) { |
|
199 NSArray *urls = [op URLs]; |
|
200 NSURL *url = [urls objectAtIndex:0]; |
|
201 |
|
202 const char *str = [[url path] UTF8String]; |
|
203 return (char*)strdup(str); |
|
204 } |
|
205 return NULL; |
|
206 } |
|
207 |
|
208 char* ui_savefiledialog(UiObject *obj) { |
|
209 NSSavePanel* sp = [NSSavePanel savePanel]; |
|
210 if ([sp runModal] == NSOKButton) { |
|
211 NSURL *url = [sp URL]; |
|
212 |
|
213 const char *str = [[url path] UTF8String]; |
|
214 return (char*)strdup(str); |
|
215 } |
|
216 return NULL; |
|
217 } |