Gtk--: Stupid string-->char conversion question



Hi,

I'm using Gtk-- and seem to have some odd behaviour
when reading data from entry boxes. Here's what I'm doing
to get the resulting input value:

     char *fname = (char *) (d_fileSelection->get_filename().data());

This works OK every once in a while but doesn't on
other times. It seems that that first time I use this, it
works OK whereas subsequent calls seem to miss
the trailing '\0', thus resuling in strings where the
first part is OK and rest is trailing garbage. Is there
anything special/sneaky about entry boxes that I
should know?

Can anybody suggest what (probably idiotic) mistake
I'm making?

Thanks a lot
--> R



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