DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2844
Version: 1.3-current


Adding a file here, 'display-issue.cxx'.

If compiled as is (on linux/flwm), no caret appears, even if you use
TAB to shift focus to/from the button.

But if you comment out the (A) line, this causes the display to take
focus, allowing the caret to appear, and it remains even if you use
tab to shift focus from it.

Also: when the caret is visible, keynav can't be used to move it;
only mouse clicks and selections can manipulate it.


Link: http://www.fltk.org/str.php?L2844
Version: 1.3-current
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Text_Display.H>

int main() {
     Fl_Double_Window *win  = new Fl_Double_Window(640, 480, "Simple 
Fl_Text_Display");
     Fl_Text_Buffer   *buff = new Fl_Text_Buffer();
     Fl_Text_Display  *disp = new Fl_Text_Display(20, 20, 640-40, 480-80);
     Fl_Button        *butt = new Fl_Button(10,480-30,140,20,"Button");
     disp->buffer(buff);
     win->end();
     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();                                // let display have 
focus on startup
     //butt->take_focus();                              // (A) comment out for 
caret to appear
     return(Fl::run());
}
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to