Get App Icon (for About Window)

Is it possible to get the set application icon? I would like to display the icon in my custom about window.

Why try to get the icon when all you need to do is to add the picture to your project ?

twice.[quote=110093:@Michel Bujardet]Why try to get the icon when all you need to do is to add the picture to your project ?[/quote]
Because this is a little step more I have to ‘remember’ when I replace the icon. And it’s a more elegant solution than just adding the icon

I disagree… but it is your app.

Code to find the Apps icon is available… but you have to add different code for each platform (assuming you are going that way)
as opposed to dragging an icon into the IDE and setting the background of a Canvas to display it.

Well, I thought there is a easy and “foolproof” way like App.Icon. So I will copy the icon to my project. Thanks for the answers.

Wish such an feature existed… it would make this task easier. but alas it does not

You can use a MessageDialog in MenuHandler

[code]dim about As New MessageDialog
about.ActionButton.Caption=“OK”
about.Icon=2
about.Message = “Info” + EndOfLine + “Info 2” _

  • EndOfLine + “Info 3”
    #if TargetMacOS then
    call about.ShowModalWithin(self)
    #else
    call about.ShowModal
    #endif
    Return True[/code]

Do I need to say the magic word “MBS”? And surely Macoslib also has something to talk to icons.

[quote=110103:@Axel Schneider]You can use a MessageDialog in MenuHandler

[code]dim about As New MessageDialog
about.ActionButton.Caption=“OK”
about.Icon=2
about.Message = “Info” + EndOfLine + “Info 2” _

  • EndOfLine + “Info 3”
    #if TargetMacOS then
    call about.ShowModalWithin(self)
    #else
    call about.ShowModal
    #endif
    Return True[/code][/quote]

Neat. I have used MsgBox for the About in a lot of my apps as well :slight_smile:

MBS is a word… for some perhaps Magic… for others not so much :slight_smile:

For OS X, check out issue 11.6 of the Xojo Developer magazine, where I’ve written a tutorial on using the OS X About Box from within Xojo. At least on the Mac, this will give you a consistent About Box and it automatically uses the application icon.

http://xojodev.com