App Icon

Sometime when I am dragging the various size icons into the IDE… when I drag a size 48x48 or smaller, ALL the icons sizes change forcing me to go back and redo the larger sizes… Anyone else see this?

Yes, if you drop the icon outside the corresponding size, then all sizes get the same icon.

Don’t do the icons in the IDE. Build them externally and add them in a copy script step. It makes loading and saving a project so much faster because the file is smaller.

and some how I think that is considered a “feature”

I’d definitely call it that. Though I’d probably have it only scale down. And only for the empty spaces.

how to do that???

@ Richard:
On the Mac side, you create a post-build script that moves your App.icns file into the Application after it was wuild.

On the Windows side: sorry, I do not know. And I am here since 1998.

What means “so much faster”?
MInutes? Seconds? Milliseconds?
Mac only or also Windows?
Reproducable (as I would call this a bug)?

Not at my Desk right now. Can you please report this as a Bug?

Because as @Thom McGrath wrote:[quote=446249:@Thom McGrath]I’d probably have it only scale down. And only for the empty spaces.[/quote]

I would talk about new feature, nt bug (additional feature: a drop of an image on that window will fill missing entries at this size and lower).

But this never bother me.

I call it that too. Some people have different needs and may not have an icon for each resolution and only one (I know, incredible) and just dragging that one icon will fill all with scaled (up/down) icon for each additional resolution.

If you don’t want to have the original problem: “sometime all icons change to lower resolution”
you just need to right click and import the icon that you want for each resolution

you will not get an import menu if you click outside one of the designated icon areas, so no need to worry that importing an icon will change all of them.

For me the way to import the icons would be:

  • drag the lowest resolution icon that I have for my app first to a not designated area, that will fill all icons
  • then import all higher resolution icons one by one with right click - import…

Edit: reading App icons — Xojo documentation there is no mention that if you drag to the window outside the icon blank areas will fill all icons with that image. Maybe they can update the docs.

@Stefan Adelsberger : I would call this an unfortunate design. Mac but I don’t think that Windows would be different. I had half a dozen file type icons and the app icon. My main project ballooned to 160-170 MB. After removing the icons I now have a 3 MB project where everything is external. The speed up when loading/saving easily is a couple of seconds each time.

@Richard Duke: there is an app called IconComposer that you can use to make an icns file. But you can also copy the file when you build your app. The script allows me to install the icons for the different versions of my app:

[code]'get paths
dim appPath as string = currentBuildLocation + “/” + shellEncode(currentBuildAppName)
if right(AppPath, 4) <> “.app” then appPath = appPath + “.app”
dim resourcesFolder as string = appPath + “/Contents/Resources/”
dim plistFile as string = appPath + “/Contents/Info.plist”
dim CountSlashes as Integer = CountFields(ProjectShellPath, “/”)
dim ProjectName as string = NthField(ProjectShellPath, “/”, CountSlashes)
dim ProjectPath as String = Left(ProjectShellPath, Len(ProjectShellPath) - Len(ProjectName))

'get name of icon
Dim iconFileName as string = readValue(plistFile, “CFBundleIconFile”)
If trim(iconFileName) = “” then
msgbox(“There was an issue reading the apps plist file, the icon cannot be correctly installed.”)
Return
end if

'try to copy icon to correct place
dim IconPath as String
if ConstantValue(“App.kMaxVersion”) = “1” then
iconPath = ProjectPath + “…/Icons/app\ icns/app_pro.icns”
end if

call copyFile(IconPath, resourcesFolder + shellEncode(iconFileName) + “.icns”, “Installing custom icon”)

// Helper functions for this script
Function shellEncode(inValue as string) as string
Dim rvalue as string = replaceAll(inValue, " ", "\ ")
rvalue = replaceAll(rvalue, “&”, “\&”)
rvalue = replaceAll(rvalue, “-”, “\-”)
rvalue = replaceAll(rvalue, “(”, “\(”)
rvalue = replaceAll(rvalue, “)”, “\)”)
return rvalue
End Function

Function copyFile(inSource as string, inTarget as string, inMethodName as string) as boolean
return execute("/bin/cp -fR " + inSource + " " + inTarget, inMethodName)
End Function

Function readValue(plistFile as string, key as string) as string
return trim(DoShellCommand( "/usr/bin/defaults read " + plistfile + " " + key))
End Function

Sub msgBox(inMessage as string, inSecondLine as string = “”)
call showDialog(inMessage, inSecondLine, “OK”, “”, “”, 0)
End Sub

Function execute(inCommand as string, inMethodName as string) as boolean
Dim result as string = DoShellCommand(inCommand)
if result <> “” then
msgbox("An error occurred while "+ inMethodName, "Message: " + result)
return false
else
return true
end if
End Function[/code]

Wow.
New empty project size = 24KB
App iconset (png icons for all sizes needed) = 42,5 KB
New empty project with icons = 10,6 MB!!!

Did you know App Wrapper has the ability to create ICNS files and include them when you wrap your application?

Drop an icns file in there and see what happens :stuck_out_tongue:

Windy operating systems were not supported by Xojo/REALbasic at that time.

I have seen what happens, that is why I posted this in the first place.

The problem is when you drag an icon to the 16x16 location for example, the drag image obsures the drop point, and if you “miss” you screw up everything.

Me, I should consider about.

[quote=446293:@Dave S]I have seen what happens, that is why I posted this in the first place.

The problem is when you drag an icon to the 16x16 location for example, the drag image obscures the drop point, and if you “miss” you screw up everything.[/quote]

that pane doesnt have an “undo” which would make that more resilient and then you could revert that one drop instead of having to cancel & then restart the entire editing

dropping an icns in there should load each of the various resolutions of the icns into the correct panes
if its not then you might want to file a bug report as that should be what happens

For setting the Windows app icon there’s really no choice to do something else. You pretty much have to edit this pane. You may be able to insert one using a resource editor after the fact. MacOS uses a separate icns file IN the bundle so its easy to replace it at several points in time before releasing you app. Not so for Windows. The icon is built right into the exe as a resource so it more or less has to be part of the project when the project is compiled (or like I said you can use a resource editor after the fact on a 64 bit app but not a 32 bit app - as far as I know 32 bit apps arent nicely editable with a resource editor because of how they are created by the compiler.

[quote=446293:@Dave S]I have seen what happens, that is why I posted this in the first place.

The problem is when you drag an icon to the 16x16 location for example, the drag image obsures the drop point, and if you “miss” you screw up everything.[/quote]

If you tend to miss on the small images, well, just start whit the smaller ones, that way if you miss, you wont screw the others. Or, you can right click -> Import to avoid misses.