Page 2 of 2
Re: Icon on title bar?
Posted: Thu Sep 16, 2010 3:29 pm
by freak
If you use PB 4.40 or newer, you can just load the image normally with PB commands, and then do:
Code: Select all
gtk_window_set_icon_(WindowID(#YourWindow), ImageID(#YourImage))
Or, if you want it to apply to all new windows, do:
Code: Select all
gtk_window_set_default_icon_(ImageID(#YourImage))
Just keep in mind that PB/Linux doesn't load *.ico files. The best is to use png's with alpha channel (don't forget UsePNGImageDecoder()

)
Re: Icon on title bar?
Posted: Thu Sep 16, 2010 7:07 pm
by Vera
Hello Shardik,
thanks for regarding my hint. As for the path - that was the first I checked, but only for the first version.
I tested it all again (several 100 times) and it's a case of driving nuts, as this time it wouldn't work with the constant until I switched back to the first code. There again it only worked once then 10 times not, then again .... the same with the world.png. But today I saw that in all cases the image is always displayed on the taskbarbutton [standart hidden on my OS] but not necessarily on the titlebar.
I have no clue why it behaves like this. I made another 10 passes of 60 compilations (devided by minimal changes) and it wouldn't even show up in each circle (1 time each in 3 passes, 2 times in 2 passes and 4 times in 1 pass).
As the application where I use your method only seldom lacks to display the icon on compilation it might be due to the shortness of the code snippet. Maybe the window is already final build up before the image can be supplied?
I would conclude it works fine (except for this special incidence) and have an eye on it when I'll apply it in coming usages.
greetings ~ Vera