PDA

View Full Version : Trim the filename like gedit


Ben Sprinkle
January 7th, 2007, 06:03 PM
In C++ using gtkmm:

title = file_open_dialog.get_filename().c_str();
set_title(title);

title is a ustring, how can I trim the filename to just show the ending file like hi.txt not /home/hi.txt etc.?

duff
January 7th, 2007, 08:07 PM
whatever the glibmm equivlant of this is:

http://developer.gnome.org/doc/API/2.0/glib/glib-Miscellaneous-Utility-Functions.html#g-path-get-basename

Ben Sprinkle
January 7th, 2007, 09:59 PM
Thanks, I will try it out.
I owe you one. ;)