Page 1 of 2

WB Icon

Posted: Mon Jul 31, 2017 11:33 pm
by r-tea
I want to use an icon for ma program.
I pointed it with SetWBIcon() function, but when i doubleclic my program I get a message window: "HollywoodPlayer: Wrong arguments specified!".
When I delete that icon then my program starts well.

Re: WB Icon

Posted: Tue Aug 01, 2017 9:39 am
by jPV
Hmm... SetWBIcon (and Application.Icon in MUIRoyale) is only used to set your iconify icon, not the actual program icon.

If you want to have a program icon which you double click to start the program, then it depends a bit in what format your program is. Is it a compiled executable, applet, or plain script file? If it's a compiled program, you just need an icon set as Tool. If it's an applet, then it should be Project icon with the default tool pointing to Hollywood Player. Maybe you're now trying to use a Project icon with a compiled executable and see the error because of that? Open the icon information window and change the icon type to Tool instead of Project.

Re: WB Icon

Posted: Wed Aug 02, 2017 10:17 pm
by r-tea
Of course I know that SetWBIcon() is for setting an appicon. I need both: an icon for my program and an appicon.
I get an icon from Aminet and I want it to be my program's icon and an appicon as well.
My program is a compiled executable, and the icon is of Tool type of course.

Re: WB Icon

Posted: Sun Aug 06, 2017 11:45 am
by airsoftsoftwair
Maybe you're using some tooltypes that conflict with Hollywood's arguments? What tooltypes have you set in your program's icon?

Re: WB Icon

Posted: Sun Aug 06, 2017 2:48 pm
by r-tea
No tooltypes set at all.
See the http://ramdisk.net.pl/t/daysleeper0.png.

Re: WB Icon

Posted: Sun Aug 06, 2017 3:33 pm
by airsoftsoftwair
Hmm, it is a NewIcon... AFAIR the NewIcon format abuses tooltypes to store certain image information. Please upload the icon somewhere so I can check what's wrong there.

Re: WB Icon

Posted: Sun Aug 06, 2017 3:47 pm
by r-tea
http://ramdisk.net.pl/t/Daysleeper.info

Btw, you're right. I have replaced the icon with a PNG one and it solved the problem. I'm pleased with it, but there is a little bitter aftertaste at the end. I prefer NewIcons - the two state glow ones. I don't like PNG. Is there a solution?

Re: WB Icon

Posted: Sun Aug 06, 2017 4:41 pm
by r-tea
Btw2, the SetWBIcon woun't work HERE.
I do like this:

Code: Select all

appicon$ = AddStr(GetCurrentDirectory(), "/Daysleeper2.info")
SetWBIcon(appicon$)
SetWBIcon(appicon$, #AMIGAICON_SHOW) 
I also tried without full path:

Code: Select all

SetWBIcon("Daysleeper2.info")
SetWBIcon("Daysleeper2.info", #AMIGAICON_SHOW) 
I tried with both: glow and PNG icons.

Does SetWBIcon() return anything to check wheather or not it exits succesfully?

Re: WB Icon

Posted: Sun Aug 06, 2017 11:06 pm
by r-tea
Can it be the SetWBIcon is ignored here at all?
I did like this SetWBIcon(appicon$, #AMIGAICON_SETTITLE) on purpose. I know #AMIGAICON_SETTITLE requires following parameter. The compiler didn't claimed it. The executable caused no error requesters.
Cubic IDE doesn't colorize this function. It made me thinking that (for some reaseon) it's ignored at all.

Re: WB Icon

Posted: Mon Aug 07, 2017 7:14 am
by jPV
It was a MUI program? You'll have to use MUI functions to set the icon then. Put icon="Daysleeper2.info" in your <application> line in the xml file. See the docs here.

BTW. you also should use FullPath when constructing directory strings.
So replace AddStr(GetCurrentDirectory(), "/Daysleeper2.info") with FullPath(GetCurrentDirectory(), "Daysleeper2.info") if you still happen to need that kind of stuff somewhere. With AddStr you may end up with paths like "Ram Disk:/Daysleeper2.info" which might not work because of / after :.