WB Icon

Discuss any general programming issues here
User avatar
r-tea
Posts: 78
Joined: Wed Feb 17, 2016 12:48 am
Location: Zdzieszowice, Poland
Contact:

WB Icon

Post by r-tea » Mon Jul 31, 2017 11:33 pm

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: 141
Joined: Sat Mar 26, 2016 11:44 am
Location: RNO
Contact:

Re: WB Icon

Post by jPV » Tue Aug 01, 2017 9:39 am

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: 78
Joined: Wed Feb 17, 2016 12:48 am
Location: Zdzieszowice, Poland
Contact:

Re: WB Icon

Post by r-tea » Wed Aug 02, 2017 10:17 pm

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: 2537
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: WB Icon

Post by airsoftsoftwair » Sun Aug 06, 2017 11:45 am

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: 78
Joined: Wed Feb 17, 2016 12:48 am
Location: Zdzieszowice, Poland
Contact:

Re: WB Icon

Post by r-tea » Sun Aug 06, 2017 2:48 pm

No tooltypes set at all.
See the http://ramdisk.net.pl/t/daysleeper0.png.

User avatar
airsoftsoftwair
Posts: 2537
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: WB Icon

Post by airsoftsoftwair » Sun Aug 06, 2017 3:33 pm

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: 78
Joined: Wed Feb 17, 2016 12:48 am
Location: Zdzieszowice, Poland
Contact:

Re: WB Icon

Post by r-tea » Sun Aug 06, 2017 3:47 pm

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: 78
Joined: Wed Feb 17, 2016 12:48 am
Location: Zdzieszowice, Poland
Contact:

Re: WB Icon

Post by r-tea » Sun Aug 06, 2017 4:41 pm

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: 78
Joined: Wed Feb 17, 2016 12:48 am
Location: Zdzieszowice, Poland
Contact:

Re: WB Icon

Post by r-tea » Sun Aug 06, 2017 11:06 pm

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: 141
Joined: Sat Mar 26, 2016 11:44 am
Location: RNO
Contact:

Re: WB Icon

Post by jPV » Mon Aug 07, 2017 7:14 am

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