Re: [gtkmm] Filling a TextView from a text file?



Use istream::get or similar to read blocks of data from the text file
and insert it into the TextView - obviously you'll have to be careful
with encodings though, and avoiding splitting utf-8 characters between
blocks (in which case reading line by line, might be easier).

Barnaby
 
On Tue, Jul 29, 2003 at 06:51:01PM +0200, Markus Gerwinski wrote:
> Hi folks,
> 
> is there a simple method to get the contents of a text file into a TextView?
> Or do I have to carry the ifstreams into the TextView char by char?
> 
> I already tried getting the text file into a ustring using the ">>" operator,
> like this:
> 
>   ustring text;
>   text_file >> text;
> 
> But this only got me the file contents up to the first space char.
> 
> Thanks in advance,
> 
>   Markus
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
> 
> 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]