How to edit .nib file to change Visual -> MyApp on Mac OS X?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

How to edit .nib file to change Visual -> MyApp on Mac OS X?

Stew MacLean

I’ve developed my app on windows and when I deploy to the Mac OS X, I’m getting Visual on the main menu bar and the VisualWorks icon.

 

Some pointers as to how I go about tailoring the main menu and the icon to the Mac (once I’ve borrowed my friends laptop), would be appreciated.

 

I believe I can use Icon Composer, but I’m not sure if that comes installed or if I have to download it.

 

I’m also not sure how I go about editing .nib files to modify the main menu.

 

Thanks,

 

Stewart

Reply | Threaded
Open this post in threaded view
|

Re: How to edit .nib file to change Visual -> MyApp on Mac OS X?

Karsten Kusche
Hi Stewart,
>
> Some pointers as to how I go about tailoring the main menu and the
> icon to the Mac (once I’ve borrowed my friends laptop), would be
> appreciated.
>

As for the icon, you should just create an image with 128x128 pixel,
preferably a png with transparency. Then you open Icon Composer (which
comes as part of the Developer Tool) and drag the file into the
different image-views. Then you save it as a .icns file and put it into
the application bundle for your app. The last step is to make sure your
icon file is specified in the info.plist of this bundle. The key is
CFBundleIconFile and the value is the name of your .icns file.

> I’m also not sure how I go about editing .nib files to modify the main
> menu.
>
I'm not sure about that one, but you may try the MacOSXExtra parcel in
the OS-Mac section of the Parcel Manager.

Kind Regards
Karsten

--
Karsten Kusche - Dipl.Inf. - [hidden email]
Georg Heeg eK - Köthen
Handelsregister: Amtsgericht Dortmund A 12812

Reply | Threaded
Open this post in threaded view
|

RE: How to edit .nib file to change Visual -> MyApp on Mac OS X?

Stew MacLean
Hi Karsten,

Thanks for the icon pointers.

I have looked at the Mac OSXExtra, and commented out the activations to
stop walkbacks, as I hadn't hooked into the events yet:

" self primActivateMenuItem: 1 state: true. "
"VisualWorks->About VisualWorks..."
" self primActivateMenuItem: 2 state: true. "
"VisualWorks->Preferences"
        self primActivateMenuItem: 3 state: true.
"VisualWorks->Quit"
" self primActivateMenuItem: 11 state: true." "Edit->Undo"
" self primActivateMenuItem: 12 state: true." "Edit->Again"
" self primActivateMenuItem: 16 state: true." "Edit->Clear"
" self primActivateMenuItem: 17 state: true." "Edit->Select
All"
" self primActivateMenuItem: 32 state: true." "Help->Topics"

What I need to do is to actually change the literal displayed ie

"VisualWorks -> About VisualWorks" becomes

"MyApp -> About MyApp".

Similarly with the other VisualWorks literals. Ideally I'd like to
remove all but About, Quit, and Help.

My understanding is that I need to edit the .nib file. These are used
for internationalisation. I'm wondering what the editor is that I should
use to do this.

Thanks,

Stewart

>-----Original Message-----
>From: Karsten [mailto:[hidden email]]
>Sent: 26 October 2007 12:28 a.m.
>To: Stewart MacLean
>Cc: [hidden email]
>Subject: Re: How to edit .nib file to change Visual -> MyApp on Mac OS
X?

>
>Hi Stewart,
>>
>> Some pointers as to how I go about tailoring the main menu and the
>> icon to the Mac (once I’ve borrowed my friends laptop), would be
>> appreciated.
>>
>
>As for the icon, you should just create an image with 128x128 pixel,
>preferably a png with transparency. Then you open Icon Composer (which
>comes as part of the Developer Tool) and drag the file into the
>different image-views. Then you save it as a .icns file and put it into
>the application bundle for your app. The last step is to make sure your
>icon file is specified in the info.plist of this bundle. The key is
>CFBundleIconFile and the value is the name of your .icns file.
>
>> I’m also not sure how I go about editing .nib files to modify the
main

>> menu.
>>
>I'm not sure about that one, but you may try the MacOSXExtra parcel in
>the OS-Mac section of the Parcel Manager.
>
>Kind Regards
>Karsten
>
>--
>Karsten Kusche - Dipl.Inf. - [hidden email]
>Georg Heeg eK - Köthen
>Handelsregister: Amtsgericht Dortmund A 12812



Reply | Threaded
Open this post in threaded view
|

Re: How to edit .nib file to change Visual -> MyApp on Mac OS X?

Andre Schnoor
Stewart MacLean wrote:
> My understanding is that I need to edit the .nib file. These are used
> for internationalisation. I'm wondering what the editor is that I should
> use to do this.
>
>  

Just double-click them. You'll need to install the developer tools,
though (in the OSX CD).

Be sure to provide your app with a unique bundle identifier (formatted
like a "domain"), otherwise many things won't work as expected. The
identifier is part of one of the .plist files, IIRC.

Andre

Reply | Threaded
Open this post in threaded view
|

Re: How to edit .nib file to change Visual -> MyApp on Mac OS X?

Karsten Kusche
Andre Schnoor wrote:
> Just double-click them. You'll need to install the developer tools,
> though (in the OSX CD).
>
> Be sure to provide your app with a unique bundle identifier (formatted
> like a "domain"), otherwise many things won't work as expected. The
> identifier is part of one of the .plist files, IIRC.
That's true, you also have to edit the bundle identifier. Stewart, in
your case you should change it to something like
co.nz.xtra.yourapplication (toplevel-domain.companyName.applicationName).

Using the Interface builder you can edit the application's menu. To use
your own menu items in VisualWorks you should set the tag of the menu
items to some number and then link this number like shown in one of the
InputState methods provided by MacOSXExtras.

You may also want to have a look at the file in
VisualWorks/packaging/macx/DeliverApps.rtf it describes how to deploy
for MacOS X.

Kind Regards
Karsten

--
Karsten Kusche - Dipl.Inf. - [hidden email]
Georg Heeg eK - Köthen
Handelsregister: Amtsgericht Dortmund A 12812

Reply | Threaded
Open this post in threaded view
|

RE: How to edit .nib file to change Visual -> MyApp on Mac OS X?

Stew MacLean
Hi Karsten,

Thanks for the Mac OS X deployment pointers.

I have already used DeliverApps.rtf to do my initial Mac OS X
deployment. It was certainly helpful.

It's now the finer details of the Icons and changing the main menu. All
made complicated by the fact that (alas!), I don't own a Mac.

At the moment I'm "shipping" using a .zip file for the Mac. I've used
NullSoft for the windows installer, and was wondering if you have any
suggestion for an installer on the Mac?

Thanks,

Stewart

>-----Original Message-----
>From: Karsten [mailto:[hidden email]]
>Sent: 26 October 2007 8:37 p.m.
>To: Stewart MacLean
>Cc: [hidden email]
>Subject: Re: How to edit .nib file to change Visual -> MyApp on Mac OS
X?
>
>Andre Schnoor wrote:
>> Just double-click them. You'll need to install the developer tools,
>> though (in the OSX CD).
>>
>> Be sure to provide your app with a unique bundle identifier
(formatted
>> like a "domain"), otherwise many things won't work as expected. The
>> identifier is part of one of the .plist files, IIRC.
>That's true, you also have to edit the bundle identifier. Stewart, in
>your case you should change it to something like
>co.nz.xtra.yourapplication
(toplevel-domain.companyName.applicationName).

>
>Using the Interface builder you can edit the application's menu. To use
>your own menu items in VisualWorks you should set the tag of the menu
>items to some number and then link this number like shown in one of the
>InputState methods provided by MacOSXExtras.
>
>You may also want to have a look at the file in
>VisualWorks/packaging/macx/DeliverApps.rtf it describes how to deploy
>for MacOS X.
>
>Kind Regards
>Karsten
>
>--
>Karsten Kusche - Dipl.Inf. - [hidden email]
>Georg Heeg eK - Köthen
>Handelsregister: Amtsgericht Dortmund A 12812



Reply | Threaded
Open this post in threaded view
|

Re: How to edit .nib file to change Visual -> MyApp on Mac OS X?

Karsten Kusche
Hi Stewart,

Do not use an installer on a mac. Only Apple does that and some other
3rd party applications, but in general an installer is not used. If your
application only contains a single file i.e. the application itself then
just use a disk image with this file inside. Disk images can also have
an EULA so it's probably the best way to ship software for a mac. If you
have to install some other components into the system you probably have
to use the installer. There's a tool called PackageMaker.app in
/Developer/Applications/Utilities for this.

To create a disk image you may have a look at:

http://el-tramo.be/guides/fancy-dmg
http://murphymac.com/slib/customized-dmg-container.htm

I prefer using FileStorm
(http://www.macupdate.com/info.php/id/9848/filestorm) for this because
it provides a VERY easy way to create disc images.

Good luck
Karsten



Stewart MacLean wrote:

> Hi Karsten,
>
> Thanks for the Mac OS X deployment pointers.
>
> I have already used DeliverApps.rtf to do my initial Mac OS X
> deployment. It was certainly helpful.
>
> It's now the finer details of the Icons and changing the main menu. All
> made complicated by the fact that (alas!), I don't own a Mac.
>
> At the moment I'm "shipping" using a .zip file for the Mac. I've used
> NullSoft for the windows installer, and was wondering if you have any
> suggestion for an installer on the Mac?
>
> Thanks,
>
> Stewart
>
>  
>> -----Original Message-----
>> From: Karsten [mailto:[hidden email]]
>> Sent: 26 October 2007 8:37 p.m.
>> To: Stewart MacLean
>> Cc: [hidden email]
>> Subject: Re: How to edit .nib file to change Visual -> MyApp on Mac OS
>>    
> X?
>  
>> Andre Schnoor wrote:
>>    
>>> Just double-click them. You'll need to install the developer tools,
>>> though (in the OSX CD).
>>>
>>> Be sure to provide your app with a unique bundle identifier
>>>      
> (formatted
>  
>>> like a "domain"), otherwise many things won't work as expected. The
>>> identifier is part of one of the .plist files, IIRC.
>>>      
>> That's true, you also have to edit the bundle identifier. Stewart, in
>> your case you should change it to something like
>> co.nz.xtra.yourapplication
>>    
> (toplevel-domain.companyName.applicationName).
>  
>> Using the Interface builder you can edit the application's menu. To use
>> your own menu items in VisualWorks you should set the tag of the menu
>> items to some number and then link this number like shown in one of the
>> InputState methods provided by MacOSXExtras.
>>
>> You may also want to have a look at the file in
>> VisualWorks/packaging/macx/DeliverApps.rtf it describes how to deploy
>> for MacOS X.
>>
>> Kind Regards
>> Karsten
>>
>> --
>> Karsten Kusche - Dipl.Inf. - [hidden email]
>> Georg Heeg eK - Köthen
>> Handelsregister: Amtsgericht Dortmund A 12812
>>    
>
>
>
>
>  

--
Karsten Kusche - Dipl.Inf. - [hidden email]
Georg Heeg eK - Köthen
Handelsregister: Amtsgericht Dortmund A 12812

Reply | Threaded
Open this post in threaded view
|

Re: Deploying MacOS X products (was: How to edit .nib file)

Andre Schnoor
Karsten wrote:

> Hi Stewart,
>
> Do not use an installer on a mac. Only Apple does that and some other
> 3rd party applications, but in general an installer is not used. If
> your application only contains a single file i.e. the application
> itself then just use a disk image with this file inside. Disk images
> can also have an EULA so it's probably the best way to ship software
> for a mac. If you have to install some other components into the
> system you probably have to use the installer. There's a tool called
> PackageMaker.app in /Developer/Applications/Utilities for this.
>
> To create a disk image you may have a look at:
>
> http://el-tramo.be/guides/fancy-dmg
> http://murphymac.com/slib/customized-dmg-container.htm
>
> I prefer using FileStorm
> (http://www.macupdate.com/info.php/id/9848/filestorm) for this because
> it provides a VERY easy way to create disc images.
>
> Good luck
> Karsten


Well, it depends on the complexity of your product. While the "dmg"
route is commonly accepted and welcome,  it requires considerable extra
effort for applications that come with lots of configuration items and
(example, template, media) documents, drivers, plug-ins etc.

Dragging an application bundle to the "Applications" folder is
user-friendly, but after that, a more comprehensive app would need to
"install itself" upon first launch, which could be tricky to implement
(at least using VW), because copying files to "/Library/Application
Support" or "/Library/Preferences" requires elevated privileges. Let
alone the quirks involved with a running app patching and restarting itself.

If a product is Mac-only, fine-tuning it to fully meet the MacOS X idiom
comes at no extra cost. For a cross-platform product however, one might
prefer to keep the common code base as large as possible, the majority
of it implemented in VW.

Actually, a disk image is a method of distribution (as compared to zip,
tgz, tar.gz, sit), rather than a means for installation. Usually it
contains a single application that is supposed to be dragged to the
"Applications" folder. If that's sufficient for your app, go for it.

If you app requires a more sophisticated setup procedure that can not be
accomplished during the first launch by the app itself, you may want to
use either a

a) Package, if you need to install drivers, system libraries, etc., or

b) Custom installer, if you have to unpack and customize lots of files
that go to folders outside the self-contained application bundle.

In either way, I would recommend not to use "tar.gz" but "zip" instead,
for a simple reason: Safari automatically unpacks a downloaded zip to a
folder, which is easily accessible and leaves no redundant garbage on
your Mac. Be sure to create the zip archive with all root items
contained in a single top-level folder. It will appear on the target Mac
after download, preserving its original name.

Andre

BTW: Possibly I missed something, but AFAIK, packages can not be easily
uninstalled (if at all). This disqualifies them as application
installers IHMO. I often refuse to install an application that comes in
a package because of this.





Reply | Threaded
Open this post in threaded view
|

Re: Deploying MacOS X products

Andre Schnoor
BTW: This is the official guide where to install application files. I
found it extremely helpful.

http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/Articles/WhereToPutFiles.html

Andre

Reply | Threaded
Open this post in threaded view
|

RE: Deploying MacOS X products (was: How to edit .nib file)

Stew MacLean
In reply to this post by Andre Schnoor

Thanks Andre and Karsten for these informative posts.

My app is very self contained and lives entirely in its own directory.

I present a click through Welcome and EULA once on start up.

Currently I use .zip, the downside is that it's not quite as "slick" as
a dmg with a background image. The upside is that I can produce it on
windows.

As I generate the .zip on a windows machine as part of my build process
for all platforms, I think I'll stick with that for now.

Cheers,

Stewart


>-----Original Message-----
>From: [hidden email] [mailto:[hidden email]]
>Sent: 30 October 2007 12:13 a.m.
>To: Karsten
>Cc: Stewart MacLean; [hidden email]
>Subject: Re: Deploying MacOS X products (was: How to edit .nib file)
>
>Karsten wrote:
>> Hi Stewart,
>>
>> Do not use an installer on a mac. Only Apple does that and some other
>> 3rd party applications, but in general an installer is not used. If
>> your application only contains a single file i.e. the application
>> itself then just use a disk image with this file inside. Disk images
>> can also have an EULA so it's probably the best way to ship software
>> for a mac. If you have to install some other components into the
>> system you probably have to use the installer. There's a tool called
>> PackageMaker.app in /Developer/Applications/Utilities for this.
>>
>> To create a disk image you may have a look at:
>>
>> http://el-tramo.be/guides/fancy-dmg
>> http://murphymac.com/slib/customized-dmg-container.htm
>>
>> I prefer using FileStorm
>> (http://www.macupdate.com/info.php/id/9848/filestorm) for this
because

>> it provides a VERY easy way to create disc images.
>>
>> Good luck
>> Karsten
>
>
>Well, it depends on the complexity of your product. While the "dmg"
>route is commonly accepted and welcome,  it requires considerable extra
>effort for applications that come with lots of configuration items and
>(example, template, media) documents, drivers, plug-ins etc.
>
>Dragging an application bundle to the "Applications" folder is
>user-friendly, but after that, a more comprehensive app would need to
>"install itself" upon first launch, which could be tricky to implement
>(at least using VW), because copying files to "/Library/Application
>Support" or "/Library/Preferences" requires elevated privileges. Let
>alone the quirks involved with a running app patching and restarting
>itself.
>
>If a product is Mac-only, fine-tuning it to fully meet the MacOS X
idiom

>comes at no extra cost. For a cross-platform product however, one might
>prefer to keep the common code base as large as possible, the majority
>of it implemented in VW.
>
>Actually, a disk image is a method of distribution (as compared to zip,
>tgz, tar.gz, sit), rather than a means for installation. Usually it
>contains a single application that is supposed to be dragged to the
>"Applications" folder. If that's sufficient for your app, go for it.
>
>If you app requires a more sophisticated setup procedure that can not
be

>accomplished during the first launch by the app itself, you may want to
>use either a
>
>a) Package, if you need to install drivers, system libraries, etc., or
>
>b) Custom installer, if you have to unpack and customize lots of files
>that go to folders outside the self-contained application bundle.
>
>In either way, I would recommend not to use "tar.gz" but "zip" instead,
>for a simple reason: Safari automatically unpacks a downloaded zip to a
>folder, which is easily accessible and leaves no redundant garbage on
>your Mac. Be sure to create the zip archive with all root items
>contained in a single top-level folder. It will appear on the target
Mac

>after download, preserving its original name.
>
>Andre
>
>BTW: Possibly I missed something, but AFAIK, packages can not be easily
>uninstalled (if at all). This disqualifies them as application
>installers IHMO. I often refuse to install an application that comes in
>a package because of this.
>
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Deploying MacOS X products

Reinout Heeck
In reply to this post by Andre Schnoor
Andre Schnoor wrote:
> BTW: Possibly I missed something, but AFAIK, packages can not be easily
> uninstalled (if at all). This disqualifies them as application
> installers IHMO. I often refuse to install an application that comes in
> a package because of this.
>

A package can offer a de-installation option.


The Parallels package has it for instance.

R
-