On 05/10/12 18:58, David Currie wrote:
> is there some example code because I can't get ANY cursor
> to show ?

        This is what I used to test your post.
        I took one of the examples, changed it to use *Display*
        instead of *Editor*, then added the '////' lines:

#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Text_Display.H>
int main() {
     Fl_Double_Window *win  = new Fl_Double_Window(640,480,"Fl_Text_Display");
     Fl_Text_Buffer   *buff = new Fl_Text_Buffer();
     Fl_Text_Display  *disp = new Fl_Text_Display(20,20,640-40,480-40);
     disp->buffer(buff);
     win->resizable(*disp);
     win->show();
     buff->text("line 0\nline 1\nline 2\n"
                "line 3\nline 4\nline 5\n"
                "line 6\nline 7\nline 8\n"
                "line 9\nline 10\nline 11\n"
                "line 12\nline 13\nline 14\n"
                "line 15\nline 16\nline 17\n"
                "line 18\nline 19\nline 20\n"
                "line 21\nline 22\nline 23\n");
     disp->show_cursor();                                       //// ENABLE 
CURSOR
     disp->cursor_style(Fl_Text_Display::CARET_CURSOR);         //// CARET 
CURSOR
     disp->insert_position(5);                                  //// POSITION 
ON 5TH CHARACTER
     disp->take_focus();                                        //// SHOW CARET 
ON STARTUP (EVEN IF NOT IN FOCUS)
     return(Fl::run());
}
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to