FLTK logo

Re: passing things from terminal to GUI

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: passing things from terminal to GUI Greg Ercolano Jun 02, 2007  
 
>     // DATA CALLBACK: Handle reading data from running command
>     void HandleFD() {
>         static char s[1024];

    BTW, if you intend to make multiple concurrent instances of EditorWindow,
    you should replace that static char s[] with just char s[].

    I made it static cause I just didn't want it to keep going in and
    out of scope on every line of data.

    Also, you can improve the speed of how it loads the data by using
    fread() instead of fgets(), so that it can load in blocks of text
    at a time, instead of line-at-a-time, which is relatively slow.

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.