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 #include #include +#include +#include +#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} };