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>

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");
  for (unsigned int ucs = 0x6653; ucs < 0x66a3; ucs++) {
    int len = fl_utf8encode(ucs, utf8);
    strncat(buffer, utf8, len);
  }
  strcat(buffer, "\n");
}

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

  Fl_Text_Display *TD = new Fl_Text_Display(10, 10, 280, 280, 0);
  Fl_Text_Buffer *TB = new Fl_Text_Buffer();
  TD->buffer(TB);
  TD->wrap_mode(1, 0);
  char* text = (char*)malloc(1024 * sizeof(char));
  text[0]='\x0';
  addToBuffer(text);
  TD->insert(text);

  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