summaryrefslogtreecommitdiff
path: root/test/cursor.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'test/cursor.cxx')
-rw-r--r--test/cursor.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/cursor.cxx b/test/cursor.cxx
index 9ae677521..7ff7ecdec 100644
--- a/test/cursor.cxx
+++ b/test/cursor.cxx
@@ -20,6 +20,9 @@
#include <FL/Fl_Choice.H>
#include <FL/fl_draw.H>
#include <FL/Fl_Box.H>
+#include <FL/Fl_Pixmap.H>
+#include <FL/Fl_RGB_Image.H>
+#include "../fluid/pixmaps/compressed.xpm"
Fl_Cursor cursor = FL_CURSOR_DEFAULT;
@@ -31,6 +34,13 @@ void choice_cb(Fl_Widget *, void *v) {
fl_cursor(cursor);
}
+void custom_cb(Fl_Widget *widget, void *) {
+ Fl_Pixmap pxm(compressed_xpm);
+ Fl_RGB_Image rgb(&pxm);
+ rgb.scale(16,16);
+ widget->top_window()->cursor(&rgb, rgb.w()/2, rgb.h()/2);
+}
+
Fl_Menu_Item choices[] = {
{"FL_CURSOR_DEFAULT",0,choice_cb,(void*)FL_CURSOR_DEFAULT},
{"FL_CURSOR_ARROW",0,choice_cb,(void*)FL_CURSOR_ARROW},
@@ -53,6 +63,7 @@ Fl_Menu_Item choices[] = {
{"FL_CURSOR_W",0,choice_cb,(void*)FL_CURSOR_W},
{"FL_CURSOR_NW",0,choice_cb,(void*)FL_CURSOR_NW},
{"FL_CURSOR_NONE",0,choice_cb,(void*)FL_CURSOR_NONE},
+ {"custom cursor",0,custom_cb,NULL},
{0}
};