diff --git a/documentation/editor.html b/documentation/editor.html index 6ea65ec2b..963b59229 100644 --- a/documentation/editor.html +++ b/documentation/editor.html @@ -570,6 +570,28 @@ void set_title(Fl_Window* w) { } +
Once we've created all of the support functions, the only thing left +is to tie them all together with the main() function. +The main() function creates a new text buffer, creates a +new view (window) for the text, shows the window, loads the file on +the command-line (if any), and then enters the FLTK event loop: + +
+int main(int argc, char **argv) {
+ textbuf = new Fl_Text_Buffer;
+
+ Fl_Window* window = new_view();
+
+ window->show(1, argv);
+
+ if (argc > 1) load_file(argv[1], -1);
+
+ return Fl::run();
+}
+
+
The complete source for our text editor can be found in the test/editor.cxx source file. Both the Makefile and Visual C++