changeset 1843:d9c83dad307a

package fltk: add test program
author Tony Theodore <tonyt@logyst.com>
date Tue, 24 May 2011 22:38:13 +1000
parents 424cdacf741d
children 564166f64492
files src/fltk-test.cpp src/fltk.mk
diffstat 2 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/fltk-test.cpp	Tue May 24 22:38:13 2011 +1000
@@ -0,0 +1,20 @@
+/* This file is part of mingw-cross-env.       */
+/* See doc/index.html for further information. */
+
+/* http://www.fltk.org/doc-1.3/basics.html     */
+#include <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Box.H>
+
+int main(int argc, char **argv)
+{
+	Fl_Window *window = new Fl_Window(340,180);
+	Fl_Box *box = new Fl_Box(20,40,300,100,"Hello, World!");
+	box->box(FL_UP_BOX);
+	box->labelfont(FL_BOLD+FL_ITALIC);
+	box->labelsize(36);
+	box->labeltype(FL_SHADOW_LABEL);
+	window->end();
+	window->show(argc, argv);
+	return Fl::run();
+}
\ No newline at end of file
--- a/src/fltk.mk	Tue May 24 22:33:41 2011 +1000
+++ b/src/fltk.mk	Tue May 24 22:38:13 2011 +1000
@@ -33,4 +33,10 @@
     # enable exceptions, because disabling them doesn't make any sense on PCs
     $(SED) -i 's,-fno-exceptions,,' '$(1)/makeinclude'
     $(MAKE) -C '$(1)' -j '$(JOBS)' install DIRS=src LIBCOMMAND='$(TARGET)-ar cr'
+    ln -sf $(PREFIX)/$(TARGET)/bin/fltk-config $(PREFIX)/bin/$(TARGET)-fltk-config
+    
+    '$(TARGET)-g++' \
+        -W -Wall -Werror -pedantic -ansi \
+        '$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-fltk.exe' \
+        `$(TARGET)-fltk-config --cxxflags --ldstaticflags`
 endef