WB Icon

Discuss any general programming issues here
User avatar
r-tea
Posts: 133
Joined: Tue Feb 16, 2016 11:48 pm
Location: Zdzieszowice, Poland
Contact:

WB Icon

Post 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.
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: WB Icon

Post 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.
User avatar
r-tea
Posts: 133
Joined: Tue Feb 16, 2016 11:48 pm
Location: Zdzieszowice, Poland
Contact:

Re: WB Icon

Post 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.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: WB Icon

Post by airsoftsoftwair »

Maybe you're using some tooltypes that conflict with Hollywood's arguments? What tooltypes have you set in your program's icon?
User avatar
r-tea
Posts: 133
Joined: Tue Feb 16, 2016 11:48 pm
Location: Zdzieszowice, Poland
Contact:

Re: WB Icon

Post by r-tea »

No tooltypes set at all.
See the http://ramdisk.net.pl/t/daysleeper0.png.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: WB Icon

Post 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.
User avatar
r-tea
Posts: 133
Joined: Tue Feb 16, 2016 11:48 pm
Location: Zdzieszowice, Poland
Contact:

Re: WB Icon

Post 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?
User avatar
r-tea
Posts: 133
Joined: Tue Feb 16, 2016 11:48 pm
Location: Zdzieszowice, Poland
Contact:

Re: WB Icon

Post 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?
User avatar
r-tea
Posts: 133
Joined: Tue Feb 16, 2016 11:48 pm
Location: Zdzieszowice, Poland
Contact:

Re: WB Icon

Post 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.
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: WB Icon

Post 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 :.
Post Reply