From 810b91471761e3d1736ed79de06b4c8a69125b30 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sun, 9 Dec 2018 17:52:55 +0100 Subject: Update examples: minor changes, rename, update .gitignore .gitignore, Makefile: add missing files, sort example filenames. Makefile.FLTK: update and extend FLTKCONFIG definition examples. Rename README.examples to README.txt (easier for Windows users). README.txt: minor edits, fix link, remove trailing whitespace. --- .gitignore | 3 +- examples/Makefile | 8 +-- examples/Makefile.FLTK | 3 +- examples/README.examples | 122 ---------------------------------------------- examples/README.txt | 123 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 131 insertions(+), 128 deletions(-) delete mode 100644 examples/README.examples create mode 100644 examples/README.txt diff --git a/.gitignore b/.gitignore index 80544a61d..36bb00266 100644 --- a/.gitignore +++ b/.gitignore @@ -78,8 +78,8 @@ /examples/howto-simple-svg /examples/howto-text-over-image-button /examples/menubar-add -/examples/nativefilechooser-simple-app /examples/nativefilechooser-simple +/examples/nativefilechooser-simple-app /examples/OpenGL3-glut-test /examples/OpenGL3test /examples/progress-simple @@ -95,6 +95,7 @@ /examples/tabs-simple /examples/textdisplay-with-colors /examples/texteditor-simple +/examples/texteditor-with-dynamic-colors /examples/tree-as-container /examples/tree-custom-draw-items /examples/tree-custom-sort diff --git a/examples/Makefile b/examples/Makefile index 08c511590..a07c265fe 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -16,10 +16,12 @@ ALL = clipboard$(EXEEXT) \ howto-simple-svg$(EXEEXT) \ howto-text-over-image-button$(EXEEXT) \ menubar-add$(EXEEXT) \ - nativefilechooser-simple$(EXEEXT) \ nativefilechooser-simple-app$(EXEEXT) \ + nativefilechooser-simple$(EXEEXT) \ progress-simple$(EXEEXT) \ shapedwindow$(EXEEXT) \ + simple-terminal$(EXEEXT) \ + SVG_File_Surface$(EXEEXT) \ table-as-container$(EXEEXT) \ table-simple$(EXEEXT) \ table-sort$(EXEEXT) \ @@ -27,16 +29,14 @@ ALL = clipboard$(EXEEXT) \ table-spreadsheet-with-keyboard-nav$(EXEEXT) \ table-with-keynav$(EXEEXT) \ tabs-simple$(EXEEXT) \ - simple-terminal$(EXEEXT) \ - SVG_File_Surface$(EXEEXT) \ textdisplay-with-colors$(EXEEXT) \ texteditor-simple$(EXEEXT) \ texteditor-with-dynamic-colors$(EXEEXT) \ - tree-simple$(EXEEXT) \ tree-as-container$(EXEEXT) \ tree-custom-draw-items$(EXEEXT) \ tree-custom-sort$(EXEEXT) \ tree-of-tables$(EXEEXT) \ + tree-simple$(EXEEXT) \ wizard-simple$(EXEEXT) # default target -- build everything diff --git a/examples/Makefile.FLTK b/examples/Makefile.FLTK index 5fe833657..52b72993a 100644 --- a/examples/Makefile.FLTK +++ b/examples/Makefile.FLTK @@ -6,7 +6,8 @@ # on your system. Common examples: # # FLTKCONFIG = /usr/local/bin/fltk-config -# FLTKCONFIG = /usr/local/src/fltk-1.3.x-svn/fltk-config +# FLTKCONFIG = /usr/local/src/fltk-1.4.x/fltk-config +# FLTKCONFIG = ../build/fltk-config # if ../build == CMake build directory # # Set .SILENT in your Makefile if you want 'quieter' builds. # diff --git a/examples/README.examples b/examples/README.examples deleted file mode 100644 index 6889eaad3..000000000 --- a/examples/README.examples +++ /dev/null @@ -1,122 +0,0 @@ -FLTK EXAMPLE PROGRAMS ---------------------- - - This directory contains example FLTK programs that demonstrate - recommended programming practices and techniques for FLTK application - programmers. The "*-simple.cxx" files are a good starting point for - those new to FLTK. - - The programs in this directory are NOT built automatically - when you build FLTK; you have to manually build them. - - The goals of these example programs: - - o Show good programming style for app programmers to emulate - - o Show simple examples of how to use widgets to new users of FLTK. - - o Show intermediate or advanced examples of techniques often - misused or hard to document - - o Demonstrate code that are FAQs on the newsgroup forum. - (such as how to use threads, callbacks, etc) - - o Example code should be short, but not at the expense of clarity. - - o Where possible, examples should emphasize FLTK's simplicity. - - -NEW SUBMISSIONS: RECOMMENDED PRACTICES - - These programs must follow FLTK coding style as defined in the FLTK - "CMP" (Configuration Management Plan/Coding Standards). - - Example code should have the above goals in mind. The best examples - are those that are as short and clear as possible; terse, but not - at the expense of clarity. - - To avoid cluttering up the top level directory with ancillary files - (such as image files or icons), examples that depend on more than - just a .cxx/.h file pair should have their own subdirectory. - - Data files common to several examples should be located in the - examples/data directory. - - Ancillary data files should be as small as possible, to keep the - distribution tar files small. Avoid high resolution images or - uncompressed images when possible. - - Examples that need large data sets (HD images, etc) should not - be part of the FLTK distribution; they can be provided as separate - packages (eg. as articles or external links). - - Some widgets have multiple capabilities that are best demonstrated - separately. For instance, the table widget can be used as a - custom data table, or as a spreadsheet, or as a widget container. - So separate examples for each would be e.g. "table-custom-data.cxx", - "table-spreadsheet.cxx", "table-widget-container.cxx", etc. - - Example programs should contain comments that help understand the - concepts shown, but not so verbose as to dwarf the code or make - the code hard to read. Within code, it's best to use single line - comments to emphasize code that might be unclear. Let the code - speak as much as possible. - - Examples programs may be referred to from the documentation - as good examples on how to do particular programming techniques. - - -NAMING CONVENTIONS - - Example programs that demonstrate a particular widget should start - with that widget's name in lowercase, eg. "table.cxx" for Fl_Table. - - Demonstrations of a particular technique should start with - "howto-xxx.cxx" to avoid naming conflicts with future widgets - of the same name. - - xxx-simple.cxx -- Simplest possible example of widget xxx - eg. table-simple.cxx - - xxx-.cxx -- A particular "technique" using widget xxx - eg. "table-spreadsheet.cxx" - - howto-.cxx -- Demonstrate a particular technique, eg. "howto-threading.cxx" - - Some example programs may depend on multiple files. To avoid - cluttering up the top level examples directory, such examples will - have their own subdirectory with the files they depend on localized - to that directory. - - Example programs should be as small as possible, to keep the - distribution tar files small. - - Very large examples, or examples that depend on large data sets - should be submitted as separate articles on the FLTK site, or as - external links on the FLTK site's 'links' page. - - -HISTORY - - Previous to FLTK 1.3.0, the fltk/test directory served the dual - purpose of containing test suites as well as example code. - - But the fltk/test programs started becoming necessarily complex, - testing for obscure problems, and not necessarily good demos for - applications programmers. - - The fltk/examples directory was created in FLTK 1.3.0 to separate - 'good programming examples' from the test suite code. - - -DISCLAIMER - - The examples in this directory are provided 'as-is', without any express - or implied warranty. In no event will the authors be held liable for - any damages arising from the use of this software. - - -BUGS - - If you find a bug, please report it through the fltk STR form at - http://fltk.org/str.php diff --git a/examples/README.txt b/examples/README.txt new file mode 100644 index 000000000..d1a53821d --- /dev/null +++ b/examples/README.txt @@ -0,0 +1,123 @@ +FLTK EXAMPLE PROGRAMS +--------------------- + + This directory contains example FLTK programs that demonstrate + recommended programming practices and techniques for FLTK application + programmers. The "*-simple.cxx" files are a good starting point for + those new to FLTK. + + The programs in this directory are NOT built automatically + when you build FLTK; you have to manually build them. + + The goals of these example programs: + + o Show good programming style for app programmers to emulate + + o Show simple examples of how to use widgets to new users of FLTK. + + o Show intermediate or advanced examples of techniques often + misused or hard to document + + o Demonstrate code that are FAQs on the newsgroup forum. + (such as how to use threads, callbacks, etc) + + o Example code should be short, but not at the expense of clarity. + + o Where possible, examples should emphasize FLTK's simplicity. + + +NEW SUBMISSIONS: RECOMMENDED PRACTICES + + These programs must follow FLTK coding style as defined in the FLTK + "CMP" (Configuration Management Plan/Coding Standards). + + Example code should have the above goals in mind. The best examples + are those that are as short and clear as possible; terse, but not + at the expense of clarity. + + To avoid cluttering up the top level directory with ancillary files + (such as image files or icons), examples that depend on more than + just a .cxx/.h file pair should have their own subdirectory. + + Data files common to several examples should be located in the + examples/data directory. + + Ancillary data files should be as small as possible, to keep the + distribution tar files small. Avoid high resolution images or + uncompressed images when possible. + + Examples that need large data sets (HD images, etc) should not + be part of the FLTK distribution; they can be provided as separate + packages (eg. as articles or external links). + + Some widgets have multiple capabilities that are best demonstrated + separately. For instance, the table widget can be used as a + custom data table, or as a spreadsheet, or as a widget container. + So separate examples for each would be e.g. "table-custom-data.cxx", + "table-spreadsheet.cxx", "table-widget-container.cxx", etc. + + Example programs should contain comments that help understand the + concepts shown, but not so verbose as to dwarf the code or make + the code hard to read. Within code, it's best to use single line + comments to emphasize code that might be unclear. Let the code + speak as much as possible. + + Examples programs may be referred to from the documentation + as good examples on how to do particular programming techniques. + + +NAMING CONVENTIONS + + Example programs that demonstrate a particular widget should start + with that widget's name in lowercase, eg. "table.cxx" for Fl_Table. + + Demonstrations of a particular technique should start with + "howto-xxx.cxx" to avoid naming conflicts with future widgets + of the same name. + + xxx-simple.cxx -- Simplest possible example of widget xxx + eg. "table-simple.cxx" + + xxx-.cxx -- A particular "technique" using widget xxx + eg. "table-spreadsheet.cxx" + + howto-.cxx -- Demonstrate a particular technique, + eg. "howto-threading.cxx" + + Some example programs may depend on multiple files. To avoid + cluttering up the top level examples directory, such examples will + have their own subdirectory with the files they depend on localized + to that directory. + + Example programs should be as small as possible, to keep the + distribution tar files small. + + Very large examples, or examples that depend on large data sets + should be submitted as separate articles on the FLTK site, or as + external links on the FLTK site's 'links' page. + + +HISTORY + + Previous to FLTK 1.3.0, the fltk/test directory served the dual + purpose of containing test suites as well as example code. + + But the fltk/test programs started becoming necessarily complex, + testing for obscure problems, and not necessarily good demos for + applications programmers. + + The fltk/examples directory was created in FLTK 1.3.0 to separate + 'good programming examples' from the test suite code. + + +DISCLAIMER + + The examples in this directory are provided 'as-is', without any express + or implied warranty. In no event will the authors be held liable for + any damages arising from the use of this software. + + +BUGS + + If you find a bug, please report it through the fltk STR form at + https://www.fltk.org/str.php -- cgit v1.2.3