Porting app to macosx

View: New views
3 Messages — Rating Filter:   Alert me  

Porting app to macosx

by Ramon Ribó :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

  Hello,

 I am porting these days a Windows/Linux app into MacOSX. The process
is going reasonably well. However, there are a few point where I would
highly appreciate the help of the MAC-TCL experts.

 1. The most important one. How can I change the name and contents of
the first-left menu that is automatically created with name "Wish" or
"Tclkit". I know about the $menu.apple trick, but I have not been able
to change the name of the menu from "Tclkit" to my app name.

 2- For testing, I have instaled ActiveTCL, however, when I double-
click a TCL file, it does not open. If I use the "Open with" and
select wish, Wish open but does not load the TCL file. What to do?

 3- I understand that, to create a MacOSX app, I need to create a
directory named "MYAPP.app" and recreate manually inside the files/
directory structure similar to other apps. Is there a better/simpler
method to do it?

 4- Once the app is created, I want to create  a dmg virtual disk
with hditool. It is very similar to a ZIP file and will contain the
MYAPP.app, a README and the license. The user will have to copy
manually the app to /Applications. Is this the best way to distribute
and app? Does it respond to user expectations?

 5- In Windows/Linux the drag&drop can be made with tkdnd. The copy/
paste of images with several tricks. Access to the tray with other
packages. How can these things be done in MacOSX?

 I think that the most important points are listed here. I shall
really appreciate some help for some/all these points and/or any other
point that someone can consider important for porting an app into
MacOSX.

PS: As a nice off-topic point, recently I have been testing strongly
Ubuntu and MacOSX. Of course, Mac is better in avoiding the strange
problems about hardware compatibility typical of Linux but only
judging the user interface, I would say that the gnome in Ubuntu is
going close or even imporoving the nice MAC GUI.


Ramon Ribó

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: Porting app to macosx

by Kevin Walzer-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

[cross posted from c.l.t]

Hi Ramon,

On 8/20/09 5:09 AM, Ramon Ribó wrote:

 > >
 > >    1. The most important one. How can I change the name and contents of
 > > the first-left menu that is automatically created with name "Wish" or
 > > "Tclkit". I know about the $menu.apple trick, but I have not been able
 > > to change the name of the menu from "Tclkit" to my app name.

If you've build an app bundle, then set the "bundle name" property in
the Info.plist file to your application name along with the
$menu.apple setting in your code.  If you're running a starpack/
starkit from the command-line, I don't think you can change the app
name in the menu.
 > >
 > >    2- For testing, I have instaled ActiveTCL, however, when I double-
 > > click a TCL file, it does not open. If I use the "Open with" and
 > > select wish, Wish open but does not load the TCL file. What to do?

Try installing Daniel Steffen's "launcher" utility--that might help.
Otherwise, run the script from the command line. That's how I test all
my stuff.

 > >
 > >    3- I understand that, to create a MacOSX app, I neead to create a
 > > directory named "MYAPP.app" and recreate manually inside the files/
 > > directory structure similar to other apps. Is there a better/simpler
 > > method to do it?

I provide an overview here.

http://www.codebykevin.com/opensource/tutorial.html

 > >
 > >    4- Once the app is created, I want to create  a dmg virtual disk
 > > with hditool. It is very similar to a ZIP file and will contain the
 > > MYAPP.app, a README and the license. The user will have to copy
 > > manually the app to /Applications. Is this the best way to distribute
 > > and app? Does it respond to user expectations?

Yes, it does. I have a shell script package that creates a DMG with a
nice background--write me off-list if you would like to see it.

 > >
 > >    5- In Windows/Linux the drag&drop can be made with tkdnd. The copy/
 > > paste of images with several tricks. Access to the tray with other
 > > packages. How can these things be done in MacOSX?

TkDND doesn't work on the Mac, no one has ever ported it. Any port of
TkDND at this point should be done against the new Tk-Cocoa
implementation which will be standard in 8.6.

As far as "system tray," what did you have in mind? Tk apps on the Mac
show up in the Dock, and have menus, notifications, bouncing icons,
etc. I also have some packages to manipulate the Dock icon (change it,
add a  badge to it, etc.)--some of these have been released, and some
are still in beta state.

If by "system tray" you mean the top bar on the right-hand-side of the
screen, where the time, battery life, Spotlight is displayed, no
package currently exists to provide Tk access to this. It can be done,
and I might put this together at some point, but not right now.

 > >
 > >    I think that the most important points are listed here. I shall
 > > really appreciate some help for some/all these points and/or any other
 > > point that someone can consider important for porting an app into
 > > MacOSX.

Hope this helps,
Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: Porting app to macosx

by Daniel A. Steffen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Aug 20, 2009 at 16:32, Kevin Walzer<kw@...> wrote:

> $menu.apple setting in your code.  If you're running a starpack/
> starkit from the command-line, I don't think you can change the app
> name in the menu.

the only way to do this that I know of  is the CPSSetProcessName SPI
unfortunately, c.f. http://wiki.tcl.tk/Ffidl

$ tclsh8.5
% package require Tk
8.5.7
% package require Ffidl
0.6.1
% ::ffidl::callout CPSSetProcessName {pointer-byte pointer-utf8}
sint32 [::ffidl::symbol
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/CoreGraphics
CPSSetProcessName] CPSSetProcessName
% CPSSetProcessName [binary format i2 {0 2}] "MyCoolApp"

note that this only changes the application menu title, and not the
application name in the Dock, that is always the filename of the
executable for single-file (unbundled) executables AFAIK (e.g.
tclsh8.5 above).

If at all possible, use an .app bundle with an Info.plist rather than
a single-file executable.

Cheers,

Daniel

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac