Reputation:
I'm quite new to Gtk3 and just learned how to load an image, but I do not want it to be hardcoded in, so I can share my app and it works for everyone without changing anything.
image = gtk_image_new_from_file("/users/me/desktop/game/earth.png");
I've tried using "./earth.png" because I know that works in legit everything else, but it didn't. As I mentioned before, I'm quite new to Gtk3 so sorry if I'm making you cringe. (btw I checked the docs and YouTube before asking this)
Upvotes: 2
Views: 275
Reputation:
Found my solution with @Gerhardh's post of detecting current directory and this TutorialGateway page on concatenating without strcat (i couldn't get strcat working). I also put a small README.md in the game folder on where to place the images, because they must be in a certain directory (home directory)
Upvotes: 1