Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » java_swt on Mac OS X 10.2.8 menu bar
java_swt on Mac OS X 10.2.8 menu bar [message #443512] Mon, 27 September 2004 06:06 Go to next message
Arthur Gouros is currently offline Arthur GourosFriend
Messages: 11
Registered: July 2009
Junior Member
Does anyone know how to remove the "SWT" menu bar on Mac OS X 10.2.8 or at
least change the name from "SWT" to my application title.

My application does not display a mac menu bar when run on 10.3.5.

My Info.plist looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM
"file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>CFBundleName</key>
<string>ManageSoft</string>
<key>CFBundleIdentifier</key>
<string>com.managesoft.client</string>
<key>CFBundleVersion</key>
<string>7.2</string>
<key>CFBundleIconFile</key>
<string>ManageSoft.icns</string>
<key>CFBundleAllowMixedLocalizations</key>
<string>true</string>
<key>CFBundleExecutable</key>
<string>selector</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>LSMultipleInstancesProhibited</key>
<true/>
<key>LSPrefersCarbon</key>
<true/>
<key>LSEnvironment</key>
<dict>
<key>java_swt_dock_icon</key>

<string> /System/Library/ManageSoft/ManageSoft.app/Contents/Resources /Man
ageSoft.icns</string>
</dict>
<key>LSUIElement</key>
<string>0</string>
</dict>
</plist>

This works well on Mac OS X 10.3.5 however it gives me an unwanted menu
bar with the label "SWT" on Mac OS X 10.2.8. I think java_swt may be the
cause but I'm not entirely sure.

Any assistance will be greatly appreciated.

Cheers,
Arthur.
Re: java_swt on Mac OS X 10.2.8 menu bar [message #443541 is a reply to message #443512] Mon, 27 September 2004 18:30 Go to previous messageGo to next message
Andre Weinand is currently offline Andre WeinandFriend
Messages: 66
Registered: July 2009
Member
On 27.9.2004 8:06 Uhr, in article cj8ak8$418$1@eclipse.org, "Arthur Gouros"
<Arthur.Gouros@managesoft.com> wrote:

> Does anyone know how to remove the "SWT" menu bar on Mac OS X 10.2.8 or at
> least change the name from "SWT" to my application title.

Since I don't really understand your problem,
could you please provide a bit more detail:

Is your app SWT based or AWT/Swing based?
Do you want a menubar and a dock entry?
What version of SWT are you using? (or better: what is the corresponding
Eclipse version?)

Thanks,
--andre
Re: java_swt on Mac OS X 10.2.8 menu bar [message #443551 is a reply to message #443541] Tue, 28 September 2004 01:19 Go to previous messageGo to next message
Arthur Gouros is currently offline Arthur GourosFriend
Messages: 11
Registered: July 2009
Junior Member
Hi Andre

> Is your app SWT based or AWT/Swing based?
My app is totally SWT based using SWT runtimes from
swt-I20040907-macosx-carbon.zip which is a 3.1 integration release.

> Do you want a menubar and a dock entry?
The customer requires a dock entry, if that option gives me a menubar,
then I would prefer to have the app name as the title rather than the word
"SWT"

A point of note is that my app gui is constructed through jellyscript, I
have not found a way to make the eclipse IDE work in this mode (I believe
it can be done) perhaps the problem may actually be some unset property
within my source that makes SWT default to using a title of "SWT" in the
menubar, maybe you can confirm whether this is the case.

Also note my correction, that this issue also happens on 10.3.5 too (I
think the Mac application cache was up to its nasty tricks again).

Cheers,
Arthur
Re: java_swt on Mac OS X 10.2.8 menu bar [message #443562 is a reply to message #443551] Tue, 28 September 2004 09:34 Go to previous messageGo to next message
Andre Weinand is currently offline Andre WeinandFriend
Messages: 66
Registered: July 2009
Member
On 28.9.2004 3:19 Uhr, in article cjae7l$u6k$1@eclipse.org, "Arthur Gouros"
<Arthur.Gouros@managesoft.com> wrote:


>> Is your app SWT based or AWT/Swing based?
> My app is totally SWT based using SWT runtimes from
> swt-I20040907-macosx-carbon.zip which is a 3.1 integration release.

Be aware: SWT for 3.0 is not supported on 10.2.8 (but probably runs if you
are not using the SWT Browser). You'll need java_swt to launch an SWT based
application.

SWT from 3.1 can be launched from /usr/bin/java or from a standard
application bundle if you are using a 1.4.2_04 JVM.

When launching via /usr/bin/java you must specify a -XstartOnFirstThread VM
argument.

In the application bundle include the following boolean argument in the Java
section:

<key>StartOnMainThread</key>
<true/>


>> Do you want a menubar and a dock entry?
> The customer requires a dock entry, if that option gives me a menubar,
> then I would prefer to have the app name as the title rather than the word
> "SWT"

Please try to set the application name with Display.setAppName(...) before
creating the Display.

> A point of note is that my app gui is constructed through jellyscript, I
> have not found a way to make the eclipse IDE work in this mode.

??? Since I haven't used Jellyscript, I don't know what specific problems
Eclipse/SWT has with it. A quick Google query doesn't return anything
useful. Could you give me a hint what Jellyscript does and how it fails with
Eclipse?

--andre
Re: java_swt on Mac OS X 10.2.8 menu bar [message #443684 is a reply to message #443562] Wed, 29 September 2004 08:13 Go to previous messageGo to next message
Arthur Gouros is currently offline Arthur GourosFriend
Messages: 11
Registered: July 2009
Junior Member
Thanks Andre,

> Be aware: SWT for 3.0 is not supported on 10.2.8
Thanks for the info, I'll pass it on to our team.

> SWT from 3.1 can be launched from /usr/bin/java or from a standard
> application bundle if you are using a 1.4.2_04 JVM.
Yes I noticed this, but since the java_swt method also works here (and
therefore in all our supported environments) I'll stick with that until
I'm forced to change should Apple or Eclipse drop the use of the
CPSEnableForegroundOperation() API.

> Please try to set the application name with Display.setAppName(...) before
> creating the Display.
Cool stuff, this did the trick. A worthy note though, it only looks like
the window title cannot be reset once the display is initialised, so you
have to run this API early, preferably before the construction of the
display. I think this behaviour may have more to do with Mac OS X than SWT.

> Could you give me a hint what Jellyscript does and how it fails with
> Eclipse?
jellyscript is an apache commons framework for referencing object methods
and properties from an xml type script. We use it to construct our GUI (we
also call SWT APIs from it too). Unfortunately this issue ruined the
elegance of this solution because I was forced to make the
Display.setAppName() call way before the jelly stuff initialised and
outside the jelly framework. Oh well.

I know jellyscript GUIs can be debugged from within Eclipse (Marcus
Crafter, a regular contibutor to these forums has managed it), but I
believe it's currently quite a challenge.

Many thanks Andre for helping me sort out this issue.

All the best
Arthur.
Re: java_swt on Mac OS X 10.2.8 menu bar [message #443748 is a reply to message #443684] Wed, 29 September 2004 20:23 Go to previous messageGo to next message
Andre Weinand is currently offline Andre WeinandFriend
Messages: 66
Registered: July 2009
Member
On 29.9.2004 10:13 Uhr, in article cjdqrd$nhp$1@eclipse.org, "Arthur Gouros"
<Arthur.Gouros@managesoft.com> wrote:

>> Please try to set the application name with Display.setAppName(...) before
>> creating the Display.
> Cool stuff, this did the trick. A worthy note though, it only looks like
> the window title cannot be reset once the display is initialised, so you
> have to run this API early, preferably before the construction of the
> display. I think this behaviour may have more to do with Mac OS X than SWT.

Yes, it is supposed to work like this on all platforms, so there seems to be
no way to change the app name after the Display has been created.

However, at least on MacOS X Apple introduced two command line options
-Xdock:name=<application name>
and
-Xdock:icon=<path to icon file>
Today they only have an effect if AWT is used.

But I've already proposed to support the latter option from within SWT too.
Now I'm convinced that the first option should be supported too. With this
you could set the app's name via the command line or from the application
bundle.

>
>> Could you give me a hint what Jellyscript does and how it fails with
>> Eclipse?
> jellyscript is an a....

Thanks for the intro.

--andre
Re: java_swt on Mac OS X 10.2.8 menu bar [message #443755 is a reply to message #443748] Wed, 29 September 2004 23:52 Go to previous messageGo to next message
Arthur Gouros is currently offline Arthur GourosFriend
Messages: 11
Registered: July 2009
Junior Member
Andre,

> However, at least on MacOS X Apple introduced two command line options
> -Xdock:name=<application name>
> and
> -Xdock:icon=<path to icon file>

I noticed that java_swt.c uses an undocumented little environment variable
called "java_swt_dock_icon" which we use (which is most useful when we
launch our app from the command line - foreground threading issues aside).
From memory, I don't think java_swt honours the -Xdock: options when run
this way (running out of a bundle invokes different behaviour out of
java_swt). Either way I hope you can continue to support this environment
variable, or fully implement the -Xdock options for command line
invocation.

Cheers,
Arthur.
Re: java_swt on Mac OS X 10.2.8 menu bar [message #444956 is a reply to message #443755] Thu, 21 October 2004 23:32 Go to previous messageGo to next message
Arthur Gouros is currently offline Arthur GourosFriend
Messages: 11
Registered: July 2009
Junior Member
Some feedback on java_swt:

With the introduction of java 1.4.2 on Mac OS X came a new java option
-XStartOnFirstThread giving application developers a alternate method of
installing their java applications. Eclipse's java_swt binary effectively
does the same thing but with a different implementation method.

My testing with the java_swt from swt-3.1M2-macosx-carbon.zip found that
my SWT GUI app can be installed and run consistantly across the following
Mac OS X/Java versions:

Java 1.3.1 -> Mac OS X 10.2.0->10.2.6
Java 1.4.1 -> Mac OS X 10.2.6->10.2.8 and 10.3.2->10.3.5
Java 1.4.2 -> Mac OS X 10.3.5->10.3.6

I couldn't test all Mac OS X/Java combinations, but the above results give
me enough confidence to say that Eclipse's java_swt solution will work for
us using just one packaging and installation methodology for all our
supported versions of Mac OS X and java. This is great for us as the news
I got Apple's devcentre is that Java 1.4.2 (-XstartonFirstThread) will not
be supported on Mac OS X 10.2.8 (i.e. old G3's that cannot be updated to
10.3.x)

Cheers,
Arthur.
Re: java_swt on Mac OS X 10.2.8 menu bar [message #444958 is a reply to message #444956] Fri, 22 October 2004 08:34 Go to previous message
Andre Weinand is currently offline Andre WeinandFriend
Messages: 66
Registered: July 2009
Member
On 22.10.2004 1:32 Uhr, in article cl9gtm$vp2$1@eclipse.org, "Arthur Gouros"
<Arthur.Gouros@managesoft.com> wrote:

> Some feedback on java_swt:
>
> With the introduction of java 1.4.2 on Mac OS X came a new java option
> -XStartOnFirstThread giving application developers a alternate method of
> installing their java applications. Eclipse's java_swt binary effectively
> does the same thing but with a different implementation method.
>
> My testing with the java_swt from swt-3.1M2-macosx-carbon.zip found that
> my SWT GUI app can be installed and run consistantly across the following
> Mac OS X/Java versions:
>
> Java 1.3.1 -> Mac OS X 10.2.0->10.2.6
> Java 1.4.1 -> Mac OS X 10.2.6->10.2.8 and 10.3.2->10.3.5
> Java 1.4.2 -> Mac OS X 10.3.5->10.3.6
>
> I couldn't test all Mac OS X/Java combinations, but the above results give
> me enough confidence to say that Eclipse's java_swt solution will work for
> us using just one packaging and installation methodology for all our
> supported versions of Mac OS X and java. This is great for us as the news
> I got Apple's devcentre is that Java 1.4.2 (-XstartonFirstThread) will not
> be supported on Mac OS X 10.2.8 (i.e. old G3's that cannot be updated to
> 10.3.x)
>
> Cheers,
> Arthur.
>

Just be aware, that pecific versions of SWT or Eclipse components require a
specific version of MacOS X and/or JVM. So for instance SWT Browser widget
isn't supported on Jaguar (10.2.x) and won't run on a 1.3.1 VM. The same is
true for SWT's font and color dialogs.

--andre
Previous Topic:How to use a TableViewer?
Next Topic:SWT pendant to QWidgetStack
Goto Forum:
  


Current Time: Thu Mar 28 20:38:32 GMT 2024

Powered by FUDForum. Page generated in 0.03881 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top