diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2011-01-01 20:27:07 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2011-01-01 20:27:07 +0000 |
| commit | 4be4baed6b0a1775817fcaf6c2673a36fc4a6e37 (patch) | |
| tree | 134c27a2a242067574cbe37c04af993a3f7274f8 /test/native-filechooser.cxx | |
| parent | 028533b451f391905f9c49258d8f9ddb39815acb (diff) | |
native filchooser test now uses system colors and resizes nicely.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8165 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test/native-filechooser.cxx')
| -rw-r--r-- | test/native-filechooser.cxx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/test/native-filechooser.cxx b/test/native-filechooser.cxx index 09cfaff39..a2f1192dc 100644 --- a/test/native-filechooser.cxx +++ b/test/native-filechooser.cxx @@ -31,6 +31,7 @@ #include <FL/Fl_Window.H> #include <FL/Fl_Button.H> #include <FL/Fl_Input.H> +#include <FL/Fl_Box.H> #include <FL/Fl_Native_File_Chooser.H> // GLOBALS @@ -70,20 +71,30 @@ int main(int argc, char **argv) { Fl_File_Icon::load_system_icons(); #endif + int argn = 1; +#ifdef __APPLE__ + // OS X may add the process number as the first argument - ignore + if (argc>argn && strncmp(argv[1], "-psn_", 5)==0) + argn++; +#endif + Fl_Window *win = new Fl_Window(600, 100, "Native File Chooser Test"); + win->size_range(300, 100, 0, 100); win->begin(); { int y = 10; G_filename = new Fl_Input(80, y, win->w()-80-10, 25, "Filename"); - G_filename->value(argc < 2 ? "." : argv[1]); + G_filename->value(argc <= argn ? "." : argv[argn]); G_filename->tooltip("Default filename"); y += G_filename->h() + 5; Fl_Button *but = new Fl_Button(win->w()-80-10, win->h()-25-10, 80, 25, "Pick File"); but->callback(Butt_CB); + Fl_Box *dummy = new Fl_Box(80, 0, 430, 100); + dummy->hide(); + win->resizable(dummy); } win->end(); - win->resizable(win); - win->show(); + win->show(argc, argv); return(Fl::run()); } |
