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

[STR New]

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





Link: http://www.fltk.org/str.php?L2158
Version: 1.3-current
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Text_Display.H>
#include <FL/Fl_Value_Slider.H>
#include <FL/Fl_Light_Button.H>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Fl_Double_Window* mainWindow = 0;
Fl_Text_Display* courierTD = 0;
Fl_Text_Buffer* courierTB = 0;
Fl_Text_Display* helveticaTD = 0;
Fl_Text_Buffer* helveticaTB = 0;

void addToBuffer(char* buffer)
{
  char utf8[10];        // more than big enough
  for (unsigned int ucs = 33; ucs < 73; ucs++) {
    int len = fl_utf8encode(ucs, utf8);
    strncat(buffer, utf8, len);
  }
  strcat(buffer, "\n");
  for (unsigned int ucs = 161; ucs < 201; ucs++) {
    int len = fl_utf8encode(ucs, utf8);
    strncat(buffer, utf8, len);
  }
  strcat(buffer, "\n");
}

int main(int argc, char* argv[])
{
  mainWindow = new Fl_Double_Window(300, 300, "wrap_mode(1, 0) test");

  courierTD = new Fl_Text_Display(10, 10, 280, 120, 0);
  courierTB = new Fl_Text_Buffer();
  courierTD->buffer(courierTB);
  courierTD->wrap_mode(1, 0);
  courierTD->textfont(FL_COURIER);
  char* courier = (char*)malloc(1024 * sizeof(char));
  strcpy(courier, "FL_COURIER:\n");
  addToBuffer(courier);
  courierTD->insert(courier);

  helveticaTD = new Fl_Text_Display(10, 140, 280, 120, 0);
  helveticaTB = new Fl_Text_Buffer();
  helveticaTD->buffer(helveticaTB);
  helveticaTD->wrap_mode(1, 0);
  helveticaTD->textfont(FL_HELVETICA);
  char* helvetica = (char*)malloc(1024 * sizeof(char));
  strcpy(helvetica, "FL_HELVETICA:\n");
  addToBuffer(helvetica);
  helveticaTD->insert(helvetica);

  mainWindow->resizable(mainWindow);
  mainWindow->show(argc, argv);
  return Fl::run();
}
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to