$HOME and gtk_file_chooser_set_current_folder



Hi, this is most likely my failure to fully understand gtk. I have enclosed the following code snippets that work and fail to work. I have a work round so it is not too bad an issue for me.

gchar WorkingPath[500] = {"$HOME/Project/" }; //FAILS (this grows as sub-projects are selected in project)

gchar WorkingPath[500] = {"~/Project/" };    //Also fails

gchar WorkingPath[500] = {"/home/name/Project/" }; //Is OKAY but if name changes to Tom, Dick or Harry oops.

Mycode()

gtk_widget_show (ChooseProjectDialog);
gtk_file_chooser_set_current_folder(filechooser, WorkingPath);

MyWorkRound()

strcpy (WorkingPath, getenv("HOME"));
strcat (WorkingPath, "/Project/");

I am curious to hear expert comments.  Regards Ian.





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