From 4be4baed6b0a1775817fcaf6c2673a36fc4a6e37 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 1 Jan 2011 20:27:07 +0000 Subject: 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 --- test/native-filechooser.cxx | 17 ++++++++++++++--- 1 file 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 #include #include +#include #include // 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()); } -- cgit v1.2.3