I’m building an app and I want to have a custom icon, instead of the OF icon that apperas on the window bar. I searched this forum and the net, but couldn’t find anything for Linux, which is my OS. Also, most threads are old, and I guess it’s likely they won’t work with recent OS versions, even for macOS and Windows.
So, my initial question is: how do I set a custon icon from a .png file on Linux?
My second question is: how do I set a custon icon on other OSes?
@alexandrosdrymonitis if you don’t want to deal with the nightly build, you just need to make that function public. If you compare the ofAppGLFWWindow.h with the latest changes, you should be able to figure it out…i.e. you can make the same changes in your 0.11.2 build.
First of all, I was putting the code to set the icon in the ofApp.cpp file, as I didn’t notice it has to go to the main.cpp file. Also, @TimChi I’m not on a Pi this time .
I realised what’s wrong. I copied my project from the stable release to the nightly build, but the compiler draws sources from the stable release, even when I’m trying to compile from the nightly build. I guess there’s some file where I need to change something, but which one is that?
Hey have you tried importing the copied project in the PG? Qt Creator has a similar option to import a project. The PG has seemingly magical powers to restore and renew a project. I find this is particularly true with Xcode, where there are a ton of IDE-related things that need to be setup correctly.
To copy a project, I typically make a new, empty one with the PG (or with Qt Creator) and then copy only the contents of the /src and /bin/data folders from the old project to the new one. This helps to keep all of the IDE stuff correct for each project.
Finally I got it to work! I tried the project generator but it didn’t either. Perhaps some shared object that was copied from the original app, or some other file was causing the compiler to draw sources from the stable release. I copied the source code only, and the rest of the stuff from the emptyExample, and it compiled with my logo on it!
Does this process apply to all OSes, or is it just Linux?
Ugh the magical powers of the PG failed! But hey that’s great that you got it working. I do like copying (only) the source code and data folder into an empty project; it’s quick and IDE-agnostic. Make is common to all platforms though (I think), so a process that uses make should be similar for all of them.