From 155e099f4a67f1031a1a77e9eba9789b74c15a44 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 13 Nov 2012 13:03:20 +0000 Subject: Documented how to make a Mac OS FLTK application launchable by dropping files on its icon. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9718 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- test/editor.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/editor.cxx b/test/editor.cxx index 3e38a5022..1c9db095f 100644 --- a/test/editor.cxx +++ b/test/editor.cxx @@ -789,16 +789,22 @@ Fl_Window* new_view() { return w; } +void cb(const char *fname) { + load_file(fname, -1); +} + int main(int argc, char **argv) { textbuf = new Fl_Text_Buffer; //textbuf->transcoding_warning_action = NULL; style_init(); + fl_open_callback(cb); Fl_Window* window = new_view(); window->show(1, argv); - +#ifndef __APPLE__ if (argc > 1) load_file(argv[1], -1); +#endif return Fl::run(); } -- cgit v1.2.3