BRL: BMax IDE icon support request

BlitzMax Forums/BlitzMax Programming/BRL: BMax IDE icon support request

QuickSilva(Posted 2009) [#1]
Hi BRL, the last BMax update was a really great one and the only thing that was disappointingly missing for me was the ability to add your own icons to your .exe`s. Most other small problems were nicely fixed so firstly, a big thank you for that.

What I would like to ask (without meaning to nag) is do you ever see this feature being added in a future version so that it is officially supported in the default IDE? Much like in the Pure Basic IDE.

I know that there are other ways to change my icons, BlIde, Resource Hacker and GreyAliens FrameWork to name a few, but it would be nice to know if there is a reason as to why this feature is still missing. If an IDE option is not a choice then how about a simple AppIcon command?

Thanks for reading,
Jason.


SLotman(Posted 2009) [#2]
Seeing that this, alongside with automatically centered window is being requested from the start (also, icon support being requested for B3D, and never implemented) - I unfortunately don't see that happen anytime soon.

That's why I implemented the AppIcon command, hacking the official modules; but it's win32 only, so I doubt it will be ever incorporated into the official modules :P


QuickSilva(Posted 2009) [#3]
I`m not so sure, I think that BRL will add it in a future update at least I hope that they will see that there is plenty of demand for what seems like a relatively small addition that would make everyones life a little easier.

Jason.


GfK(Posted 2009) [#4]
Seeing that this, alongside with automatically centered window is being requested from the start (also, icon support being requested for B3D, and never implemented) - I unfortunately don't see that happen anytime soon.
Windows are automatically centered in 1.32.


N(Posted 2009) [#5]
but it would be nice to know if there is a reason as to why this feature is still missing.
Because icons are supported very differently between the supported platforms. How big do you make an icon on Windows? It's certainly not as big as you make them on Mac OS. How about Linux? They're all different, and in this regard handling them in a generic way is rather impractical without imposing some unusual restrictions or having severely reduced quality on all but one platform.

You're better off making your icons and attaching them using tools specific to that platform.


*(Posted 2009) [#6]
+1 for icon support


GaryV(Posted 2009) [#7]
Windows are automatically centered in 1.32.
Never let facts get in the way of a good whine ;)

How big do you make an icon on Windows?
256x256 for program icons (as PNGs) unless Windows 7 requires something larger?


N(Posted 2009) [#8]
256x256 for program icons (as PNGs) unless Windows 7 requires something larger?
That's too small for it to work between Windows and Mac OS (Mac OS requires a maximum of 512x512). The max is probably different for Linux as well.


GaryV(Posted 2009) [#9]
Thats why I answered Windows only ;)


N(Posted 2009) [#10]
At any rate, you're still better off using a tool specific to your platform for the icons, rather than trying to cram the same feature into the IDE across platforms where the means of using icons is not very similar at all.


jkrankie(Posted 2009) [#11]
if you've got Blide pro, this feature is built in. You can copy and paste icons in the apps get info window on Macs, so that's no biggie.

cheers
Charlie


N(Posted 2009) [#12]
You can copy and paste icons in the apps get info window on Macs, so that's no biggie.
That's actually not how you do it. That works for user customization, but is definitely not how you should be distributing applications.


SLotman(Posted 2009) [#13]

>> Windows are automatically centered in 1.32.
Never let facts get in the way of a good whine ;)


Not whining... I just didn't install 1.32 seeing the compiling problems it has with always building all modules. And since there was nothing on the release text, I didn't know about it.

And I stand on my AppIcon. It's not to put an ICON on the EXE, but in the Window. As Brucey informed me in the thread where I posted my AppIcon "hack", MacOS don't have windows icons (the little ones, on the top left of the window), so it's only a matter of implementing the Linux version for it.

So you just have to point AppIcon$ to the path of the icon you want to be loaded when your window is created. Or set it to "", so it won't load anything. No size/format restriction, since you can set AppIcon to anything in runtime or compile time.


N(Posted 2009) [#14]
And I stand on my AppIcon. It's not to put an ICON on the EXE, but in the Window. As Brucey informed me in the thread where I posted my AppIcon "hack", MacOS don't have windows icons (the little ones, on the top left of the window), so it's only a matter of implementing the Linux version for it.
AppIcon for Mac OS would most likely change the dock icon at runtime.


jkrankie(Posted 2009) [#15]


That's actually not how you do it. That works for user customization, but is definitely not how you should be distributing applications.



Why is that then? i could edit the .plist file i know, but i've never had any problems distributing stuff that i've pasted the icon into.

Cheers
Charlie


N(Posted 2009) [#16]
Why is that then? i could edit the .plist file i know, but i've never had any problems distributing stuff that i've pasted the icon into.
What happens if a user over-writes your icon? There's no default for it to go back to, so you've then got a situation where the icon cannot be reset.

On another note, I'm fiddling with writing some code to set the dock icon at runtime (AppIcon for Mac OS, basically).


N(Posted 2009) [#17]
Here's a quick example of how to set the image for a dock tile under MacOS:

AppIcon.bmx


appicon.macos.m
#import <Cocoa/Cocoa.h>

void bbSetAppIcon( void* bytes, int len )
{
	NSData* imageData = [NSData dataWithBytesNoCopy:bytes length:len freeWhenDone:YES];
	NSImage* image = [[[NSImage alloc] initWithData:imageData] autorelease];
	[[NSApplication sharedApplication] setApplicationIconImage:image];
}


It's depressingly simple. If you want badges, that's a little more involved, but not hard. Refer to this for more.


TaskMaster(Posted 2009) [#18]
If the reason it is not included is because of the icon file size/bit depth, etc. The simplest thing is to require a windows.ico, mac.ico, and a linux.ico (or whatever the proper extension is). Then whichever you compile, it could grab the appropriate icon file.


Grey Alien(Posted 2009) [#19]
@Nillium: Nice code but I'm a little confused. Why is that code needed when you can just put an icon in the resources folder of the game.app folder and that icon will automatically show on the dock bar? Of course every time you compile BMax overwrites that icon, but you have to set the icon in the final version for release anyway.


N(Posted 2009) [#20]
@Nillium: Nice code but I'm a little confused. Why is that code needed when you can just put an icon in the resources folder of the game.app folder and that icon will automatically show on the dock bar? Of course every time you compile BMax overwrites that icon, but you have to set the icon in the final version for release anyway.
That lets you set it at runtime (without overwriting the original icon). So, say, you want to change the icon to something that shows something other than the default icon.

The more interesting thing to do would be to set a custom view so you can use badges, really.