Editing the Text

To keep things simple our text editor will use the Fl_Multiline_Input widget to edit the text:

Fl_Multiline_Input *input = new Fl_Multiline_Input(0, 30, 640, 450);
      

So that we can keep track of changes to the file, we also want to add a "changed" callback:

input->callback(changed_cb);
input->when(FL_WHEN_CHANGED);
      

Finally, we want to use a mono-spaced font like FL_COURIER:

input->textfont(FL_COURIER);