Re: [gtkmm] Problems saving and loading the text data in widgets



Ken Miller schrieb:
I am writing a an rpg utility and I want to save the character sheets and
load them back.  I seem to have gotten the info saved to a file.( although I

There already exists an gtkmm/glademm based RPG character sheet program (also with a windows port) ;-) : midgard.berlios.de

[if you want to take a look I recommend the GTKMM1 branch (also available as rpms) since the gtkmm2 version is being reorganized (might not always compile/work)]

would love pointers on doing this efficiently).  What is giving me problems
currently is loading strings from a file.  I am using:
Ifstream in("file");
string str;
in >> str;
entry1->set_text(str.c_str());//this is a pointer because glade generated my
                                gui code.

The first line of the file is:
This is an entry

But this is the only thing that shows up in the widget.

What am I doing wrong?

Expecting too much? Whitespace separates strings in streans (IIRC). But without actual code I can't help you more.

I second the (lib)XML proposition.

   Christof





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